From fa56a4e54004b5a5e91d303b90cd8fa77931bce4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 20 Jun 2023 17:29:01 +0200 Subject: [PATCH 01/20] refs #5879 Jenkinsfile: debuild updated --- Jenkinsfile | 2 +- debian/changelog | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f264da26..3e434ad2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { } agent { docker { - image 'registry.verdnatura.es/debuild:2.21.3-vn2' + image 'registry.verdnatura.es/debuild:2.23.4-vn1' registryUrl 'https://registry.verdnatura.es/' registryCredentialsId 'docker-registry' args '-v /mnt/appdata/reprepro:/reprepro' diff --git a/debian/changelog b/debian/changelog index 32948892..99c20630 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.6.14) stable; urgency=low +hedera-web (23.6.15) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 25c533dc..70237436 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.6.14", + "version": "23.6.15", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 4231365e4f6a8f23badae14e8615648a60485d77 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 10 Jul 2023 07:52:24 +0200 Subject: [PATCH 02/20] refs #5863 add echos --- web/service.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/service.php b/web/service.php index 97e19a4e..eb858c43 100644 --- a/web/service.php +++ b/web/service.php @@ -150,6 +150,7 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; + echo $_SERVER['HTTP_AUTHORIZATION'] . " _ " . $_GET['access_token'] . "\n"; if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -178,7 +179,7 @@ abstract class Service { if (!$isActive) throw new UserDisabledException(); } - + echo $user . "\n"; $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -187,6 +188,7 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access + echo $_SESSION['access'] . " _ " . $userChanged . " _ " . $_SESSION['user'] . "\n"; if (isset($_SESSION['access']) && $userChanged) $db->query( From f638143e3ee22b56563f7acf9b663a1aff92cdad Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 10 Jul 2023 08:43:15 +0200 Subject: [PATCH 03/20] refs #5863 echos --- web/service.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/service.php b/web/service.php index eb858c43..cbdfcc90 100644 --- a/web/service.php +++ b/web/service.php @@ -150,7 +150,8 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; - echo $_SERVER['HTTP_AUTHORIZATION'] . " _ " . $_GET['access_token'] . "\n"; + echo "Start login logs\n"; + echo "_SERVER_HTTP_AUTHORIZATION: " . $_SERVER['HTTP_AUTHORIZATION'] . " _GET_Access_token: " . $_GET['access_token'] . "EndLine\n"; if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -179,7 +180,7 @@ abstract class Service { if (!$isActive) throw new UserDisabledException(); } - echo $user . "\n"; + echo "user: " . $user . "EndLine\n"; $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -188,7 +189,8 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access - echo $_SESSION['access'] . " _ " . $userChanged . " _ " . $_SESSION['user'] . "\n"; + echo "SESSION_Access: " . $_SESSION['access'] . " _userChanged: " . $userChanged . " _SESSION_User: " . $_SESSION['user'] . "EndLine\n"; + echo "End login logs\n"; if (isset($_SESSION['access']) && $userChanged) $db->query( From 32cc865290619ecb5bbd1f415c20f4add613fd14 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 10 Jul 2023 09:17:16 +0200 Subject: [PATCH 04/20] refs #5863 remove echos --- web/service.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/web/service.php b/web/service.php index cbdfcc90..d1420093 100644 --- a/web/service.php +++ b/web/service.php @@ -150,8 +150,6 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; - echo "Start login logs\n"; - echo "_SERVER_HTTP_AUTHORIZATION: " . $_SERVER['HTTP_AUTHORIZATION'] . " _GET_Access_token: " . $_GET['access_token'] . "EndLine\n"; if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -180,7 +178,6 @@ abstract class Service { if (!$isActive) throw new UserDisabledException(); } - echo "user: " . $user . "EndLine\n"; $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -189,9 +186,6 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access - echo "SESSION_Access: " . $_SESSION['access'] . " _userChanged: " . $userChanged . " _SESSION_User: " . $_SESSION['user'] . "EndLine\n"; - echo "End login logs\n"; - if (isset($_SESSION['access']) && $userChanged) $db->query( 'CALL visitUser_new(#, #)', From 2af58510668169478efd7936d8d49d06064cd9ff Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 11 Jul 2023 09:18:34 +0200 Subject: [PATCH 05/20] refs #5863 add echos in login --- debian/changelog | 2 +- package.json | 2 +- web/service.php | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 99c20630..95a29c36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.6.15) stable; urgency=low +hedera-web (23.6.16) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 70237436..cff2bfe8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.6.15", + "version": "23.6.16", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/web/service.php b/web/service.php index d1420093..bd4204d1 100644 --- a/web/service.php +++ b/web/service.php @@ -150,6 +150,9 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; + echo "Start login logs\n"; + echo "_SERVER_HTTP_AUTHORIZATION: " . $_SERVER['HTTP_AUTHORIZATION'] . " _GET_Access_token: " . $_GET['access_token'] . "EndLine\n"; + if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -178,6 +181,8 @@ abstract class Service { if (!$isActive) throw new UserDisabledException(); } + + echo "user: " . $user . "EndLine\n"; $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -186,6 +191,8 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access + echo "SESSION_Access: " . $_SESSION['access'] . " _userChanged: " . $userChanged . " _SESSION_User: " . $_SESSION['user'] . "EndLine\n"; + echo "End login logs\n"; if (isset($_SESSION['access']) && $userChanged) $db->query( 'CALL visitUser_new(#, #)', From 86be0278a6f9249ad9b07f12e8bbe5804f3773b9 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 11 Jul 2023 11:35:15 +0200 Subject: [PATCH 06/20] refs #5863 add echos in login --- web/service.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/service.php b/web/service.php index d1420093..d18bd6b8 100644 --- a/web/service.php +++ b/web/service.php @@ -150,6 +150,9 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; + error_log("Start login logs\n"); + error_log("_SERVER_HTTP_AUTHORIZATION: " . $_SERVER['HTTP_AUTHORIZATION'] . " _GET_Access_token: " . $_GET['access_token'] . "EndLine\n"); + if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -178,6 +181,8 @@ abstract class Service { if (!$isActive) throw new UserDisabledException(); } + + error_log("user: " . $user . "EndLine\n"); $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -186,6 +191,8 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access + error_log("SESSION_Access: " . $_SESSION['access'] . " _userChanged: " . $userChanged . " _SESSION_User: " . $_SESSION['user'] . "EndLine\n"); + error_log("End login logs\n"); if (isset($_SESSION['access']) && $userChanged) $db->query( 'CALL visitUser_new(#, #)', From d17bc6115ffec04ecabc7e217e29cec6f533a6af Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 12 Jul 2023 07:17:20 +0200 Subject: [PATCH 07/20] refs #5863 logout remove $_SESSION['user'] --- js/vn/json-connection.js | 1 + rest/user/logout.php | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 rest/user/logout.php diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index 6a088aaa..e06a0c4e 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -86,6 +86,7 @@ module.exports = new Class({ headers: {'Authorization': token} }; await this.post('Accounts/logout', null, config); + await this.send('user/logout'); } }, diff --git a/rest/user/logout.php b/rest/user/logout.php new file mode 100644 index 00000000..a7e7e849 --- /dev/null +++ b/rest/user/logout.php @@ -0,0 +1,7 @@ + Date: Wed, 12 Jul 2023 08:34:47 +0200 Subject: [PATCH 08/20] refs #5863 fix remove user session --- debian/changelog | 2 +- package.json | 2 +- web/service.php | 14 ++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index b067011e..51881885 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.6.17) stable; urgency=low +hedera-web (23.6.18) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 109f2cf3..155089d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.6.17", + "version": "23.6.18", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/web/service.php b/web/service.php index d18bd6b8..f9ee20f3 100644 --- a/web/service.php +++ b/web/service.php @@ -150,9 +150,6 @@ abstract class Service { if (!empty($_GET['access_token'])) $token = $_GET['access_token']; - error_log("Start login logs\n"); - error_log("_SERVER_HTTP_AUTHORIZATION: " . $_SERVER['HTTP_AUTHORIZATION'] . " _GET_Access_token: " . $_GET['access_token'] . "EndLine\n"); - if (isset($token)) { $userId = $db->getValue( 'SELECT userId FROM salix.AccessToken @@ -161,8 +158,10 @@ abstract class Service { [$token] ); - if (!$userId) + if (!$userId) { + $_SESSION['user'] = null; throw new SessionExpiredException(); + } $anonymousUser = FALSE; $user = $db->getValue( @@ -178,11 +177,12 @@ abstract class Service { [$user] ); - if (!$isActive) + if (!$isActive) { + $_SESSION['user'] = null; throw new UserDisabledException(); + } } - error_log("user: " . $user . "EndLine\n"); $db->query('CALL account.myUser_loginWithName(#)', [$user]); $userChanged = !$anonymousUser @@ -191,8 +191,6 @@ abstract class Service { $_SESSION['user'] = $user; // Registering the user access - error_log("SESSION_Access: " . $_SESSION['access'] . " _userChanged: " . $userChanged . " _SESSION_User: " . $_SESSION['user'] . "EndLine\n"); - error_log("End login logs\n"); if (isset($_SESSION['access']) && $userChanged) $db->query( 'CALL visitUser_new(#, #)', From 754b8cd6c48593c3aec5a0aa5d4c0117ec26f6ef Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 27 Jul 2023 21:55:17 +0200 Subject: [PATCH 09/20] refs #6079 Add tag 8 & modify france phone --- debian/changelog | 2 +- forms/cms/why/locale/fr.yml | 7 ++++--- forms/ecomerce/catalog/style.scss | 2 +- forms/ecomerce/catalog/ui.xml | 7 ++++++- js/hedera/locale/fr.yml | 2 +- package.json | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 51881885..755bef2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.6.18) stable; urgency=low +hedera-web (23.30.1) stable; urgency=low * Initial Release. diff --git a/forms/cms/why/locale/fr.yml b/forms/cms/why/locale/fr.yml index 5052a7b7..75ac3e97 100644 --- a/forms/cms/why/locale/fr.yml +++ b/forms/cms/why/locale/fr.yml @@ -13,7 +13,8 @@ BecauseOurSalesDep: >- Pour nos professionnels de service commercial qui sera toujours de trouver une solution à vos besoins. BecauseOurWorkShop: Parce que nous avons un atelier de couture pour aider. -BecauseWeHaveWhatYouNeed: Parce que nous avons ce que vous avez besoin quand vous en avez besoin ... +BecauseWeHaveWhatYouNeed: >- + Parce que nous avons ce que vous avez besoin quand vous en avez besoin ... AboutDesc: >- Nous sommes une société spécialisée dans le commerce de gros et de la distribution d'une large gamme d'accessoires, des verts et des fleurs à des @@ -31,6 +32,6 @@ AboutDisp: >- Mercaflor - Mercavalencia (Valencia) qui effectuent des ventes directes seulement. AboutOrder: >- - Vous pouvez faire vos commandes et réservations par téléphone au +33 781 533 - 900, en ligne grâce à notre site Internet ou directement dans nos + Vous pouvez faire vos commandes et réservations par téléphone au +33 783 285 + 437, en ligne grâce à notre site Internet ou directement dans nos installations. diff --git a/forms/ecomerce/catalog/style.scss b/forms/ecomerce/catalog/style.scss index a1cef51c..76d3036f 100644 --- a/forms/ecomerce/catalog/style.scss +++ b/forms/ecomerce/catalog/style.scss @@ -266,7 +266,7 @@ flex: auto; overflow: hidden; margin: 10px; - height: 170px; + height: 185px; & > h2 { max-height: 3rem; diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index b8871eb7..be118a1c 100644 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -115,7 +115,8 @@ WHERE #filter; CALL myOrder_calcCatalogFull(#orderId); SELECT i.id, i.longName item, i.subName, - i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, + i.tag5, i.value5, i.tag6, i.value6, + i.tag7, i.value7, i.tag8, i.value8, i.relevancy, i.size, i.category, k.name ink, p.name producer, o.name origin, b.available, b.price, b.`grouping`, @@ -186,6 +187,10 @@ {{item.tag7}} {{item.value7}} + + {{item.tag8}} + {{item.value8}} +
diff --git a/js/hedera/locale/fr.yml b/js/hedera/locale/fr.yml index 70c5d47b..7bc99938 100644 --- a/js/hedera/locale/fr.yml +++ b/js/hedera/locale/fr.yml @@ -5,7 +5,7 @@ Remind me: Retenir mon mot de passe Log in as guest: Entrez en tant qu'invité Login: Se connecter Login mail: info@verdnatura.es -Login phone: +33 781 533 900 +Login phone: +33 783 285 437 Password forgotten? Push here: Vous avez oublié votre mot de passe? Yet you are not a customer?: Vous n'êtes pas encore client? Sign up: S'inscrire diff --git a/package.json b/package.json index 155089d2..e982d0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.6.18", + "version": "23.30.1", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 0f3ddb1a99fd0b52b5f0f871359e7feaae6a0def Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 28 Jul 2023 10:16:28 +0200 Subject: [PATCH 10/20] hotFix(logout): correct order --- js/vn/json-connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index e06a0c4e..cd15c8ef 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -85,8 +85,8 @@ module.exports = new Class({ const config = { headers: {'Authorization': token} }; - await this.post('Accounts/logout', null, config); await this.send('user/logout'); + await this.post('Accounts/logout', null, config); } }, From d37493b081dddfaeb26f1a0395ce3af4ae22eb87 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 28 Jul 2023 13:11:33 +0200 Subject: [PATCH 11/20] ticket #097414 Fix: Use client language --- debian/changelog | 2 +- package.json | 2 +- rest/core/query.php | 13 +++++++++---- web/rest-service.php | 8 ++++++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 755bef2a..ad8892e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.1) stable; urgency=low +hedera-web (23.30.2) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index e982d0b0..d8689b05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.1", + "version": "23.30.2", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/core/query.php b/rest/core/query.php index 4d398e93..cbd056dd 100644 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -1,6 +1,7 @@ moreResults() && $db->nextResult()); if ($db->checkWarnings() - &&($result = $db->query('SHOW WARNINGS'))) { - $sql = 'SELECT `description`, @warn `code` - FROM `message` WHERE `code` = @warn'; + && ($result = $db->query('SHOW WARNINGS'))) { + $sql = + 'SELECT IFNULL(i.`description`, m.`description`) `description`, @warn `code` + FROM `message` m + LEFT JOIN `messageI18n` i + ON i.`code` = m.`code` AND i.lang = # + WHERE m.`code` = @warn'; while ($row = $result->fetch_object()) { if ($row->Code == 1265 - &&($warning = $db->getObject($sql))) + && ($warning = $db->getObject($sql, [Locale::get()]))) trigger_error("{$warning->code}: {$warning->description}", E_USER_WARNING); else trigger_error("{$row->Code}: {$row->Message}", E_USER_WARNING); diff --git a/web/rest-service.php b/web/rest-service.php index ded4fd94..bb10717c 100644 --- a/web/rest-service.php +++ b/web/rest-service.php @@ -54,8 +54,12 @@ class RestService extends Service { if ($e->getCode() == 1644) { $eMessage = $e->getMessage(); $tMessage = $db->getValue( - 'SELECT `description` FROM `messageL10n` WHERE `code` = #', - [$eMessage] + 'SELECT IFNULL(i.`description`, m.`description`) `description` + FROM `message` m + LEFT JOIN `messageI18n` i + ON i.`code` = m.`code` AND i.lang = # + WHERE m.`code` = #', + [Locale::get(), $eMessage] ); if (!$tMessage) $tMessage = $eMessage; throw new Lib\UserException($tMessage, $eMessage); From a59c44fb3aca5acb84e8b1bf52aa84963d378475 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 2 Aug 2023 08:49:49 +0200 Subject: [PATCH 12/20] refs #5863 Version increased --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad8892e6..d3d8e3f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.2) stable; urgency=low +hedera-web (23.30.3) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index d8689b05..4de0696a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.2", + "version": "23.30.3", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 08b4a3437c853f29d7f5e626f35cb0a17354a6e5 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 7 Aug 2023 07:25:11 +0200 Subject: [PATCH 13/20] refs #5762 feat(changePassword): salix compatibility --- debian/changelog | 2 +- forms/account/conf/index.js | 78 +--------------------- forms/account/conf/ui.xml | 69 +------------------- js/hedera/locale/ca.yml | 17 +++++ js/hedera/locale/es.yml | 19 ++++++ js/hedera/locale/fr.yml | 17 +++++ js/hedera/locale/pt.yml | 17 +++++ js/hedera/login.js | 12 +++- js/hedera/login.xml | 1 + js/htk/change-password/index.js | 111 ++++++++++++++++++++++++++++++++ js/htk/change-password/ui.xml | 62 ++++++++++++++++++ js/htk/htk.js | 33 +++++----- package.json | 2 +- 13 files changed, 279 insertions(+), 161 deletions(-) create mode 100644 js/htk/change-password/index.js create mode 100644 js/htk/change-password/ui.xml diff --git a/debian/changelog b/debian/changelog index 755bef2a..ad8892e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.1) stable; urgency=low +hedera-web (23.30.2) stable; urgency=low * Initial Release. diff --git a/forms/account/conf/index.js b/forms/account/conf/index.js index c603b618..55d73abc 100644 --- a/forms/account/conf/index.js +++ b/forms/account/conf/index.js @@ -7,79 +7,7 @@ export default new Class({ activate() { this.$.userModel.setInfo('c', 'myClient', 'hedera'); this.$.userModel.setInfo('u', 'myUser', 'account'); - - if (this.hash.$.verificationToken) - this.onPassChangeClick(); + this.$.changePassword.conn = this.conn + this.$.changePassword.user = this.gui.user } - - ,onPassChangeClick() { - this.$.oldPassword.value = ''; - this.$.newPassword.value = ''; - this.$.repeatPassword.value = ''; - - var verificationToken = this.hash.$.verificationToken; - this.$.oldPassword.style.display = verificationToken ? 'none' : 'block'; - this.$.changePassword.show(); - - if (verificationToken) - this.$.newPassword.focus(); - else - this.$.oldPassword.focus(); - } - - ,async onPassModifyClick() { - const form = this.$.changePassword.node; - Vn.Node.disableInputs(form); - try { - const oldPassword = this.$.oldPassword.value; - const newPassword = this.$.newPassword.value; - const repeatedPassword = this.$.repeatPassword.value; - - try { - if (newPassword == '' && repeatedPassword == '') - throw new Error(_('Passwords empty')); - if (newPassword !== repeatedPassword) - throw new Error(_('Passwords doesn\'t match')); - } catch (err) { - return Htk.Toast.showError(err.message); - } - - const verificationToken = this.hash.$.verificationToken; - const params = {newPassword}; - - try { - if (verificationToken) { - params.verificationToken = verificationToken; - await this.conn.send('user/restore-password', params); - } else { - let userId = this.gui.user.id; - params.oldPassword = oldPassword; - await this.conn.patch( - `Accounts/${userId}/changePassword`, params); - } - } catch(err) { - Htk.Toast.showError(err.message); - - if (verificationToken) - this.$.newPassword.select(); - else - this.$.oldPassword.select(); - - return; - } - - this.hash.unset('verificationToken'); - await this.conn.open(this.gui.user.name, newPassword); - this.$.changePassword.hide(); - } finally { - Vn.Node.disableInputs(form, false); - } - - Htk.Toast.showMessage(_('Password changed!')); - } - - ,onPassInfoClick() { - this.$.passwordInfo.show(); - } -}); - +}); \ No newline at end of file diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml index 86d7c29b..d5e936ea 100644 --- a/forms/account/conf/ui.xml +++ b/forms/account/conf/ui.xml @@ -1,11 +1,5 @@ - - - SELECT length, nAlpha, nUpper, nDigits, nPunct - FROM account.userPassword - - SELECT u.id, u.name, u.email, u.nickname, @@ -27,7 +21,7 @@ + on-click="this.$.changePassword.open()"/>
@@ -74,64 +68,5 @@
- -
-
-
- Change password -
- - - -
-
- - -
-
-
- - -
-
- Password requirements -
-
    -
  • - {{passwordForm.length}} characters long -
  • -
  • - {{passwordForm.nAlpha}} alphabetic characters -
  • -
  • - {{passwordForm.nUpper}} capital letters -
  • -
  • - {{passwordForm.nDigits}} digits -
  • -
  • - {{passwordForm.nPunct}} symbols -
  • -
-
-
+ diff --git a/js/hedera/locale/ca.yml b/js/hedera/locale/ca.yml index 5ccdff26..d72f6e86 100644 --- a/js/hedera/locale/ca.yml +++ b/js/hedera/locale/ca.yml @@ -65,3 +65,20 @@ Account: Compte Addresses: Adreces Load an order: Si us plau carrega una comanda pendent a la cistella o en comença una de nova + +Old password: Contrasenya antiga +New password: Nova contrasenya +Repeat password: Repetir contrasenya +Requirements: Requisits +Modify: Modificar +Password requirements: Requisits de contrasenya +characters long: caràcters de longitud +alphabetic characters: caràcters alfabètics +capital letters: majúscules +digits: dígits +symbols: símbols +Password changed!: Contrasenya modificada! +Password doesn't meet the requirements: '' +Passwords doesn't match: Les contrasenyes no coincideixen! +Passwords empty: Les contrasenyes en blanc +Change password: Canvia la contrasenya \ No newline at end of file diff --git a/js/hedera/locale/es.yml b/js/hedera/locale/es.yml index 4fcf5573..746b0cb7 100644 --- a/js/hedera/locale/es.yml +++ b/js/hedera/locale/es.yml @@ -65,3 +65,22 @@ Account: Cuenta Addresses: Direcciones Load an order: Por favor carga un pedido pendiente en la cesta o empieza uno nuevo + +Old password: Contaseña antigua +New password: Nueva contraseña +Repeat password: Repetir contraseña +Requirements: Requisitos +Modify: Modificar +Password requirements: Requisitos de constraseña +characters long: carácteres de longitud +alphabetic characters: carácteres alfabéticos +capital letters: letras mayúsculas +digits: dígitos +symbols: 'símbolos. Ej: $%&.' +Password changed!: ¡Contraseña modificada! +Password doesn't meet the requirements: >- + La nueva contraseña no reune los requisitos de seguridad necesarios, pulsa en + info para más detalle +Passwords doesn't match: ¡Las contraseñas no coinciden! +Passwords empty: Contraseña vacía +Change password: Cambiar contraseña \ No newline at end of file diff --git a/js/hedera/locale/fr.yml b/js/hedera/locale/fr.yml index 7bc99938..8402c07b 100644 --- a/js/hedera/locale/fr.yml +++ b/js/hedera/locale/fr.yml @@ -65,3 +65,20 @@ Account: Compte Addresses: Adresses Load an order: Veuillez télécharger une commande en attente dans le panier ou en démarrer une nouvelle + +Old password: Ancien mot de passe +New password: Nouveau mot de passe +Repeat password: Répéter le mot de passe +Requirements: Exigences +Modify: Modifier +Password requirements: Mot de passe exigences +characters long: Longs caractères +alphabetic characters: les caractères alphabétiques +capital letters: lettres majuscules +digits: chiffres +symbols: 'symboles. Ej: $%&.' +Password changed!: Mot de passe modifié! +Password doesn't meet the requirements: '' +Passwords doesn't match: Les mots de passe ne correspondent pas! +Passwords empty: '' +Change password: Changer le mot de passe \ No newline at end of file diff --git a/js/hedera/locale/pt.yml b/js/hedera/locale/pt.yml index 8e3cfe61..bc7c6eae 100644 --- a/js/hedera/locale/pt.yml +++ b/js/hedera/locale/pt.yml @@ -63,3 +63,20 @@ Account: Conta Addresses: Moradas Load an order: Carregue um pedido pendente no carrinho ou inicie um novo + +Old password: Palavra-passe antiga +New password: Nova Palavra-passe +Repeat password: Repetir Palavra-passe +Requirements: Requisitos +Modify: Modificar +Password requirements: Requisitos de Palavra-passe +characters long: caracteres +alphabetic characters: caracteres alfabéticos +capital letters: letras maiúsculas +digits: dígitos +symbols: 'símbolos. Ej: $%&.' +Password changed!: Palavra-passe Modificada! +Password doesn't meet the requirements: Palavra-passe não atende aos requisitos +Passwords doesn't match: As Palavras-Passe não coincidem! +Passwords empty: Palavra-passe vazia +Change password: Mudar Palavra-passe \ No newline at end of file diff --git a/js/hedera/login.js b/js/hedera/login.js index 870518f6..3cc16484 100644 --- a/js/hedera/login.js +++ b/js/hedera/login.js @@ -26,6 +26,12 @@ module.exports = new Class({ self._onSubmit(); return false; }; + + if(this.hash.$.verificationToken){ + this.$.changePassword.conn = this.conn; + this.$.changePassword.token = this.hash.$.verificationToken; + this.$.changePassword.open(); + } } ,_onConnLoadChange(conn, isLoading) { @@ -94,7 +100,11 @@ module.exports = new Class({ return; } - await this._conn.send('user/recover-password', {recoverUser}); + await this.conn.post('VnUsers/recoverPassword', { + user: recoverUser, + app: 'hedera' + }); + Htk.Toast.showMessage(_('A mail has been sent wich you can recover your password')); } }); diff --git a/js/hedera/login.xml b/js/hedera/login.xml index 9b97e7bb..f82b2602 100644 --- a/js/hedera/login.xml +++ b/js/hedera/login.xml @@ -54,4 +54,5 @@
+ diff --git a/js/htk/change-password/index.js b/js/htk/change-password/index.js new file mode 100644 index 00000000..6494513d --- /dev/null +++ b/js/htk/change-password/index.js @@ -0,0 +1,111 @@ +var Component = require('vn/component'); +var Toast = require('../toast'); +var Tpl = require('./ui.xml').default; + +/** + * A change password popup. + */ +module.exports = new Class({ + Extends: Component, + Tag: 'htk-change-password', + Properties: { + /** + * The token url. + */ + token: { + type: String + ,set(value) { + this._token = value; + } + ,get() { + return this._token; + } + }, + conn: { + type: Db.Connection + ,set(x) { + this._conn = x + } + ,get() { + return this._conn; + } + }, + user: { + type: Object + } + }, + + initialize(props) { + Component.prototype.initialize.call(this, props); + }, + + async open() { + this.passwordForm = await this.conn.get('UserPasswords/findOne') + this.loadTemplateFromString(Tpl); + + this.$.oldPassword.value = ''; + this.$.newPassword.value = ''; + this.$.repeatPassword.value = ''; + + this.$.oldPassword.style.display = this.token ? 'none' : 'block'; + this.$.changePassword.open(); + + if (this.token) + this.$.newPassword.focus(); + else + this.$.oldPassword.focus(); + }, + + async onPassModifyClick() { + const form = this.$.changePassword.node; + Vn.Node.disableInputs(form); + try { + const oldPassword = this.$.oldPassword.value; + const newPassword = this.$.newPassword.value; + const repeatedPassword = this.$.repeatPassword.value; + + try { + if (newPassword == '' && repeatedPassword == '') + throw new Error(_('Passwords empty')); + if (newPassword !== repeatedPassword) + throw new Error(_('Passwords doesn\'t match')); + } catch (err) { + return Toast.showError(err.message); + } + + const params = {newPassword}; + + + try { + if (this.token) { + const headers = { + Authorization: this.token + }; + await this.conn.post('VnUsers/reset-password', params, {headers}); + } else { + params.userId = this.user.id; + params.oldPassword = oldPassword; + + await this.conn.patch(`Accounts/change-password`, params); + } + } catch(err) { + Toast.showError(err.message); + + if (this.token) + this.$.newPassword.select(); + else + this.$.oldPassword.select(); + + return; + } + + if(this.user) + await this.conn.open(this.user.name, newPassword); + this.$.changePassword.hide(); + } finally { + Vn.Node.disableInputs(form, false); + } + + Toast.showMessage(_('Password changed!')); + } +}); diff --git a/js/htk/change-password/ui.xml b/js/htk/change-password/ui.xml new file mode 100644 index 00000000..ebd8c92c --- /dev/null +++ b/js/htk/change-password/ui.xml @@ -0,0 +1,62 @@ + + +
+
+
+ Change password +
+ + + +
+
+ + +
+
+
+ + +
+
+ Password requirements +
+
    +
  • + {{this.passwordForm.length}} characters long +
  • +
  • + {{this.passwordForm.nAlpha}} alphabetic characters +
  • +
  • + {{this.passwordForm.nUpper}} capital letters +
  • +
  • + {{this.passwordForm.nDigits}} digits +
  • +
  • + {{this.passwordForm.nPunct}} symbols +
  • +
+
+
+ diff --git a/js/htk/htk.js b/js/htk/htk.js index 5cc21c26..8297fefe 100644 --- a/js/htk/htk.js +++ b/js/htk/htk.js @@ -3,22 +3,23 @@ require('db/db'); require('./style/index.scss'); Htk = module.exports = { - Popup : require('./popup') - ,Dialog : require('./dialog') - ,Toast : require('./toast') - ,Repeater : require('./repeater') - ,Grid : require('./grid') - ,Spinner : require('./spinner') - ,Icon : require('./icon') - ,FullImage : require('./full-image') - ,ImageEditor : require('./image-editor') - ,Assistant : require('./assistant') - ,AssistantBar : require('./assistant-bar') - ,Step : require('./step') - ,Loader : require('./loader') - ,List : require('./list') - ,Field : require('./field') - ,Column : require('./column') + Popup : require('./popup') + ,Dialog : require('./dialog') + ,Toast : require('./toast') + ,Repeater : require('./repeater') + ,Grid : require('./grid') + ,Spinner : require('./spinner') + ,Icon : require('./icon') + ,FullImage : require('./full-image') + ,ImageEditor : require('./image-editor') + ,Assistant : require('./assistant') + ,AssistantBar : require('./assistant-bar') + ,Step : require('./step') + ,Loader : require('./loader') + ,List : require('./list') + ,Field : require('./field') + ,Column : require('./column') + ,ChangePassword : require('./change-password') }; var Fields = { diff --git a/package.json b/package.json index e982d0b0..d8689b05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.1", + "version": "23.30.2", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 8f98597ea24947d43dc852231d967bc8500dbf4d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 21 Aug 2023 11:41:51 +0200 Subject: [PATCH 14/20] refs #5863 Fixes: Mailer, logout & run db --- debian/changelog | 2 +- js/vn/json-connection.js | 15 ++++++++------- package.json | 4 ++-- web/mailer.php | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index d3d8e3f7..96c0943d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.3) stable; urgency=low +hedera-web (23.30.4) stable; urgency=low * Initial Release. diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index cd15c8ef..9d6c7deb 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -85,7 +85,7 @@ module.exports = new Class({ const config = { headers: {'Authorization': token} }; - await this.send('user/logout'); + await this.send('user/logout', null, config); await this.post('Accounts/logout', null, config); } }, @@ -140,15 +140,16 @@ module.exports = new Class({ /* * Called when REST response is received. */ - async sendWithUrl(method, url, params) { - return this.request({ + async sendWithUrl(method, url, params, config) { + config = Object.assign({}, config, { method, url, - data: Vn.Url.makeUri(params), - headers: { - 'Content-Type': 'application/x-www-form-urlencoded' - } + data: Vn.Url.makeUri(params) }); + config.headers = Object.assign({}, config.headers, { + 'Content-Type': 'application/x-www-form-urlencoded' + }); + return this.request(config); }, async get(url, config) { diff --git a/package.json b/package.json index 4de0696a..9bc75f5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.3", + "version": "23.30.4", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { @@ -42,7 +42,7 @@ "scripts": { "front": "webpack serve --open", "back": "cd ../salix && gulp backOnly", - "db": "cd ../vn-database && myvc run", + "db": "cd ../vn-database && myt run", "build": "rm -rf build/ ; webpack", "clean": "rm -rf build/" } diff --git a/web/mailer.php b/web/mailer.php index 88c56c32..e388b6ab 100644 --- a/web/mailer.php +++ b/web/mailer.php @@ -5,6 +5,7 @@ namespace Vn\Web; require_once 'libphp-phpmailer/autoload.php'; use Vn\Lib\UserException; +use PHPMailer\PHPMailer\PHPMailer; class Mailer { private $conf; @@ -19,7 +20,7 @@ class Mailer { function createObject($mailTo, $body, $subject) { $conf = $this->conf; - $mail = new \PHPMailer(); + $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = $conf->host; From 620bd53262c777de135ee3af33254abaa611fd3e Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 30 Aug 2023 17:48:23 +0200 Subject: [PATCH 15/20] refs #5879 Fixes: PHP max upload filesize --- debian/changelog | 2 +- debian/links | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 96c0943d..54f83ad0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.4) stable; urgency=low +hedera-web (23.30.5) stable; urgency=low * Initial Release. diff --git a/debian/links b/debian/links index ba27c5f5..41972147 100644 --- a/debian/links +++ b/debian/links @@ -1,3 +1,3 @@ usr/share/hedera-web/hedera-web.php usr/bin/hedera-web.php etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf -etc/hedera-web/php.ini etc/php/7.0/apache2/conf.d/99-hedera-web.ini \ No newline at end of file +etc/hedera-web/php.ini etc/php/8.2/apache2/conf.d/99-hedera-web.ini \ No newline at end of file diff --git a/package.json b/package.json index 9bc75f5b..b5051590 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.30.4", + "version": "23.30.5", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 6915e06c719f1a1e996de11561158e930000bb07 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 9 Oct 2023 19:51:59 +0200 Subject: [PATCH 16/20] refs #6200 Minimal amount --- debian/changelog | 2 +- forms/ecomerce/catalog/locale/ca.yml | 1 + forms/ecomerce/catalog/locale/en.yml | 1 + forms/ecomerce/catalog/locale/es.yml | 1 + forms/ecomerce/catalog/locale/fr.yml | 1 + forms/ecomerce/catalog/locale/pt.yml | 1 + forms/ecomerce/catalog/style.scss | 12 ++++++++++++ forms/ecomerce/catalog/ui.xml | 14 +++++++++++++- package.json | 3 ++- 9 files changed, 33 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 54f83ad0..16f9e02c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.30.5) stable; urgency=low +hedera-web (23.40.1) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/catalog/locale/ca.yml b/forms/ecomerce/catalog/locale/ca.yml index 31ee9147..1062b6e0 100644 --- a/forms/ecomerce/catalog/locale/ca.yml +++ b/forms/ecomerce/catalog/locale/ca.yml @@ -46,3 +46,4 @@ NoMoreAmountAvailable: No hi ha més quantitat disponible MinimalGrouping: Empaquetat mínim Available: Disponible GroupingPrice: Preu per grup +MinimalQuantity: Quantitat mínima diff --git a/forms/ecomerce/catalog/locale/en.yml b/forms/ecomerce/catalog/locale/en.yml index 6940d979..7ee71528 100644 --- a/forms/ecomerce/catalog/locale/en.yml +++ b/forms/ecomerce/catalog/locale/en.yml @@ -46,3 +46,4 @@ NoMoreAmountAvailable: No more amount available MinimalGrouping: Minimal packing Available: Available GroupingPrice: Price per group +MinimalQuantity: Minimal quantity diff --git a/forms/ecomerce/catalog/locale/es.yml b/forms/ecomerce/catalog/locale/es.yml index 776ef9ba..20efddc7 100644 --- a/forms/ecomerce/catalog/locale/es.yml +++ b/forms/ecomerce/catalog/locale/es.yml @@ -46,3 +46,4 @@ NoMoreAmountAvailable: No hay más cantidad disponible MinimalGrouping: Empaquetado mínimo Available: Disponible GroupingPrice: Precio per grupo +MinimalQuantity: Cantidad mínima diff --git a/forms/ecomerce/catalog/locale/fr.yml b/forms/ecomerce/catalog/locale/fr.yml index bd6266b7..4d84a99a 100644 --- a/forms/ecomerce/catalog/locale/fr.yml +++ b/forms/ecomerce/catalog/locale/fr.yml @@ -46,3 +46,4 @@ NoMoreAmountAvailable: Pas plus disponible MinimalGrouping: Emballage minimal Available: Disponible GroupingPrice: Prix par groupe +MinimalQuantity: Quantité minimum diff --git a/forms/ecomerce/catalog/locale/pt.yml b/forms/ecomerce/catalog/locale/pt.yml index 9ade502e..02f793fe 100644 --- a/forms/ecomerce/catalog/locale/pt.yml +++ b/forms/ecomerce/catalog/locale/pt.yml @@ -46,3 +46,4 @@ NoMoreAmountAvailable: Não há mais quantidade disponível MinimalGrouping: Embalagem mínima Available: Disponível GroupingPrice: Preço por grupo +MinimalQuantity: Quantidade mínima diff --git a/forms/ecomerce/catalog/style.scss b/forms/ecomerce/catalog/style.scss index 76d3036f..f2ff4378 100644 --- a/forms/ecomerce/catalog/style.scss +++ b/forms/ecomerce/catalog/style.scss @@ -194,6 +194,17 @@ } } +.min-quantity { + position: absolute; + bottom: 30px; + right: 0; + + & > span { + font-size: 18px; + vertical-align: middle; + } +} + /* Tags */ .grid-view, @@ -351,6 +362,7 @@ & > .top { padding: 14px; + position: relative; & > .item-info { margin-left: 126px; diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index be118a1c..8bc3f3e6 100644 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -117,7 +117,7 @@ SELECT i.id, i.longName item, i.subName, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7, i.tag8, i.value8, - i.relevancy, i.size, i.category, + i.relevancy, i.size, i.category, i.minQuantity, k.name ink, p.name producer, o.name origin, b.available, b.price, b.`grouping`, i.image, im.updated @@ -203,6 +203,12 @@ {{Vn.Value.format(item.price, '%.02d€')}}
+
+ + production_quantity_limits + + {{item.minQuantity}} +
@@ -461,6 +467,12 @@ +
+ {{card.minQuantity}} + + production_quantity_limits + +
Date: Mon, 9 Oct 2023 20:20:01 +0200 Subject: [PATCH 17/20] refs #6200 Style fixes --- debian/changelog | 2 +- forms/ecomerce/catalog/index.js | 8 ++++++++ forms/ecomerce/catalog/style.scss | 12 +++++++++++- forms/ecomerce/catalog/ui.xml | 7 ++++--- package.json | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 16f9e02c..93f3feba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.40.1) stable; urgency=low +hedera-web (23.40.2) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/catalog/index.js b/forms/ecomerce/catalog/index.js index 80e85d5b..ed297040 100644 --- a/forms/ecomerce/catalog/index.js +++ b/forms/ecomerce/catalog/index.js @@ -202,6 +202,12 @@ const Catalog = new Class({ this.hideMenu(); } + + ,itemRenderer(builder, form) { + var minQuantity = builder.$.minQuantity; + minQuantity.style.display = form.$.minQuantity + ? 'block' : 'hidden'; + } ,realmRenderer(builder, form) { var link = builder.$.link; @@ -273,6 +279,8 @@ const Catalog = new Class({ orderId: this.orderId }); this.$.cardPopup.show(event.currentTarget); + this.$.cardMinQuantity.style.display = form.$.minQuantity + ? 'block' : 'none'; } ,onAddLotClick(column, value, row) { diff --git a/forms/ecomerce/catalog/style.scss b/forms/ecomerce/catalog/style.scss index f2ff4378..7f0b998d 100644 --- a/forms/ecomerce/catalog/style.scss +++ b/forms/ecomerce/catalog/style.scss @@ -192,15 +192,20 @@ margin: 0; margin-bottom: 1px; } + & > .min-quantity { + bottom: 30px; + right: 0; + } } .min-quantity { position: absolute; bottom: 30px; right: 0; + font-size: .8rem; & > span { - font-size: 18px; + font-size: 16px; vertical-align: middle; } } @@ -383,6 +388,11 @@ margin-top: 15px 0; font-size: .9rem; } + & > .min-quantity { + bottom: 0; + right: 0; + padding: 14px; + } } & > .lots-grid { border-top: 1px solid #DDD; diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 8bc3f3e6..35f0115b 100644 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -149,7 +149,8 @@ id="grid-view" empty-message="_Choose filter from right menu" form-id="item" - model="items"> + model="items" + renderer="itemRenderer">
-
+
production_quantity_limits @@ -467,7 +468,7 @@ -
+
{{card.minQuantity}} production_quantity_limits diff --git a/package.json b/package.json index 2fd90425..06a8834c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.40.1", + "version": "23.40.2", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 4a09fe39a80a79db9632cd9750412301a98d6fd4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 9 Oct 2023 21:01:11 +0200 Subject: [PATCH 18/20] refs #6200 style fixes, mock local date --- debian/changelog | 2 +- forms/admin/visits/index.js | 4 +-- forms/cms/contact/index.js | 2 +- forms/ecomerce/catalog/style.scss | 4 ++- forms/ecomerce/catalog/ui.xml | 4 +-- forms/ecomerce/checkout/index.js | 6 ++-- forms/reports/shelves/index.js | 2 +- js/htk/calendar/index.js | 4 +-- js/htk/image/index.js | 2 +- js/vn/cookie.js | 52 +++++++++++++------------------ js/vn/date.js | 16 ++++++++++ package.json | 2 +- rest/edi/lib/segment.php | 2 +- 13 files changed, 56 insertions(+), 46 deletions(-) diff --git a/debian/changelog b/debian/changelog index 93f3feba..45f25338 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.40.2) stable; urgency=low +hedera-web (23.40.3) stable; urgency=low * Initial Release. diff --git a/forms/admin/visits/index.js b/forms/admin/visits/index.js index 78f093d8..02f5fa16 100644 --- a/forms/admin/visits/index.js +++ b/forms/admin/visits/index.js @@ -7,8 +7,8 @@ export default new Class({ ,activate() { if (!this.hash.$.to) this.hash.assign({ - from: new Date(), - to: new Date() + from: Date.vnNew(), + to: Date.vnNew() }); } }); diff --git a/forms/cms/contact/index.js b/forms/cms/contact/index.js index 7bff0faf..9e9d6f68 100644 --- a/forms/cms/contact/index.js +++ b/forms/cms/contact/index.js @@ -14,7 +14,7 @@ export default new Class({ ,refreshCaptcha() { params = { srv: 'rest:misc/captcha', - stamp: new Date().getTime() + stamp: Date.vnNew().getTime() }; this.$.captchaImg.src = '?'+ Vn.Url.makeUri(params); } diff --git a/forms/ecomerce/catalog/style.scss b/forms/ecomerce/catalog/style.scss index 7f0b998d..c218c348 100644 --- a/forms/ecomerce/catalog/style.scss +++ b/forms/ecomerce/catalog/style.scss @@ -193,16 +193,18 @@ margin-bottom: 1px; } & > .min-quantity { - bottom: 30px; + bottom: 32px; right: 0; } } .min-quantity { position: absolute; + display: none; bottom: 30px; right: 0; font-size: .8rem; + color: #c44; & > span { font-size: 16px; diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 35f0115b..26a80fda 100644 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -469,10 +469,10 @@
- {{card.minQuantity}} production_quantity_limits - + + {{card.minQuantity}}
diff --git a/forms/ecomerce/checkout/index.js b/forms/ecomerce/checkout/index.js index d556c66d..99e07177 100644 --- a/forms/ecomerce/checkout/index.js +++ b/forms/ecomerce/checkout/index.js @@ -8,7 +8,7 @@ export default new Class({ this.autoStepLocked = true; this.$.assistant.stepsIndex = this.agencySteps; - this.today = new Date(); + this.today = Date.vnNew(); this.today.setHours(0, 0, 0, 0); }, @@ -22,8 +22,8 @@ export default new Class({ let date; const row = orderForm.$ || defaultsForm.$ || {}; - if (!date || date.getTime() < (new Date()).getTime()) { - date = new Date(); + if (!date || date.getTime() < (Date.vnNew()).getTime()) { + date = Date.vnNew(); date.setHours(0, 0, 0, 0); let addDays = 0; diff --git a/forms/reports/shelves/index.js b/forms/reports/shelves/index.js index 0cbb379c..1fd0d8d0 100644 --- a/forms/reports/shelves/index.js +++ b/forms/reports/shelves/index.js @@ -6,7 +6,7 @@ export default new Class({ activate() { this.$.lot.assign({ - date: new Date(), + date: Date.vnNew(), useIds: false }); }, diff --git a/js/htk/calendar/index.js b/js/htk/calendar/index.js index 24f757ef..ae265941 100644 --- a/js/htk/calendar/index.js +++ b/js/htk/calendar/index.js @@ -141,7 +141,7 @@ module.exports = new Class({ } ,goToCurrentMonth() { - var date = new Date(); + var date = Date.vnNew(); this.goToMonth(date.getFullYear(), date.getMonth()); } @@ -179,7 +179,7 @@ module.exports = new Class({ // Marks the current day - var today = new Date(); + var today = Date.vnNew(); if (this.year == today.getFullYear() && this.month == today.getMonth()) { diff --git a/js/htk/image/index.js b/js/htk/image/index.js index efe3a752..e73fdc06 100644 --- a/js/htk/image/index.js +++ b/js/htk/image/index.js @@ -192,7 +192,7 @@ module.exports = new Class({ } ,_onFileUpload(cell) { - this._stamp = new Date().getTime(); + this._stamp = Date.vnNew().getTime(); this._refreshSrc(cell); this.popup.hide(); } diff --git a/js/vn/cookie.js b/js/vn/cookie.js index 7ab233e1..8e90dfae 100644 --- a/js/vn/cookie.js +++ b/js/vn/cookie.js @@ -3,69 +3,61 @@ */ module.exports = { - set: function (key, value, days) - { + set: function(key, value, days) { var strCookie = key + '=' + value + ';'; - if (days != undefined) - { - var date = new Date (); - date.setTime (date.getTime () + days * 86400000); - strCookie += 'expires=' + date.toGMTString (); + if (days != undefined) { + var date = Date.vnNew(); + date.setTime(date.getTime() + days * 86400000); + strCookie += 'expires=' + date.toGMTString(); } document.cookie = strCookie; } - ,unset: function (key) - { - this.set (key, '', -1); + ,unset: function(key) { + this.set(key, '', -1); } - ,get: function (key) - { - var cookie = new String (document.cookie); - var start = cookie.indexOf (key + '='); + ,get: function(key) { + var cookie = new String(document.cookie); + var start = cookie.indexOf(key + '='); - if (start != -1) - { + if (start != -1) { var end; start += key.length + 1; - end = cookie.indexOf (';', start); + end = cookie.indexOf(';', start); if (end > 0) - return cookie.substring (start, end); + return cookie.substring(start, end); else - return cookie.substring (start); + return cookie.substring(start); } return null; } - ,getInt: function (key) - { - var value = this.get (key); + ,getInt: function(key) { + var value = this.get(key); if (value != null) - return parseInt (value); + return parseInt(value); return null; } - ,getFloat: function (key) - { - var value = this.get (key); + ,getFloat: function(key) { + var value = this.get(key); if (value != null) - return parseFloat (value); + return parseFloat(value); return null; } - ,check: function (key) - { - return this.get (key) != null; + ,check: function(key) { + return this.get(key) != null; } }; diff --git a/js/vn/date.js b/js/vn/date.js index 470315fb..594a07dc 100644 --- a/js/vn/date.js +++ b/js/vn/date.js @@ -6,6 +6,22 @@ Date.prototype.clone = function() { return new Date(this.getTime()); } +Date.vnUTC = () => { + const env = process.env.NODE_ENV; + if (!env || env === 'development') + return new Date(Date.UTC(2001, 0, 1, 11)); + + return new Date(); +}; + +Date.vnNew = () => { + return new Date(Date.vnUTC()); +}; + +Date.vnNow = () => { + return new Date(Date.vnUTC()).getTime(); +}; + module.exports = { WDays: [ diff --git a/package.json b/package.json index 06a8834c..1a31fab3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.40.2", + "version": "23.40.3", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/edi/lib/segment.php b/rest/edi/lib/segment.php index 6e6f52b3..e25bd007 100644 --- a/rest/edi/lib/segment.php +++ b/rest/edi/lib/segment.php @@ -18,7 +18,7 @@ class Segment { switch ($type) { case Type::DATE: - $tmp = new Date(); + $tmp = Date.vnNew(); $tmp->setDate(substr($v, 0, 4), substr($v, 4, 2), substr($v, 6, 2)); return $tmp; case Type::TIME: From 1535a557a8c0bb4962a0610d30c0319963348732 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 9 Oct 2023 21:08:40 +0200 Subject: [PATCH 19/20] refs #6200 Fixes: style & add to basket --- debian/changelog | 2 +- forms/ecomerce/catalog/index.js | 2 +- forms/ecomerce/catalog/style.scss | 3 ++- package.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 45f25338..df99b5be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.40.3) stable; urgency=low +hedera-web (23.40.4) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/catalog/index.js b/forms/ecomerce/catalog/index.js index ed297040..a550f0ac 100644 --- a/forms/ecomerce/catalog/index.js +++ b/forms/ecomerce/catalog/index.js @@ -325,7 +325,7 @@ const Catalog = new Class({ } if (amountSum > 0) { - this.conn.execQuery(sql); + await this.conn.execQuery(sql); var itemName = this.$.$card.get('item'); Htk.Toast.showMessage( diff --git a/forms/ecomerce/catalog/style.scss b/forms/ecomerce/catalog/style.scss index c218c348..8fcc25b4 100644 --- a/forms/ecomerce/catalog/style.scss +++ b/forms/ecomerce/catalog/style.scss @@ -204,7 +204,8 @@ bottom: 30px; right: 0; font-size: .8rem; - color: #c44; + color: #a44; + cursor: pointer; & > span { font-size: 16px; diff --git a/package.json b/package.json index 1a31fab3..df1f922b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.40.3", + "version": "23.40.5", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From fba880fb330815b0012e94dde77c039dd0c65039 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 10 Oct 2023 09:37:29 +0200 Subject: [PATCH 20/20] refs #6200 Version increased --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index df99b5be..ee25dfca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (23.40.4) stable; urgency=low +hedera-web (23.40.6) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index df1f922b..ef46e548 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "23.40.5", + "version": "23.40.6", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": {