From 3f637fff80cd0684269706ed33fd11dba4fcc2d6 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio <juan@verdnatura.es>
Date: Mon, 3 Oct 2022 15:50:39 +0200
Subject: [PATCH] Minor fixes

---
 debian/changelog             |  2 +-
 forms/admin/photos/photos.js |  6 +++---
 forms/admin/photos/style.css |  4 ++--
 js/hedera/tpv.js             | 20 +++++++++++---------
 js/vn/hash.js                |  2 +-
 package.json                 |  2 +-
 6 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ff97a93d..936ffd3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-hedera-web (1.408.12) stable; urgency=low
+hedera-web (1.408.13) stable; urgency=low
 
   * Initial Release.
 
diff --git a/forms/admin/photos/photos.js b/forms/admin/photos/photos.js
index 79b78584..f51c8e1a 100644
--- a/forms/admin/photos/photos.js
+++ b/forms/admin/photos/photos.js
@@ -83,7 +83,7 @@ Hedera.Photos = new Class({
 
 			if (fileData.status === Status.NONE) {
 				this.setImageStatus(
-					fileData, Status.WAITING, 'cloud-upload', _('Waiting for upload'));
+					fileData, Status.WAITING, 'cloud_upload', _('Waiting for upload'));
 				fileData.name.disabled = true;
 				this.uploadQueue.push(fileData);
 				count++;
@@ -121,7 +121,7 @@ Hedera.Photos = new Class({
 
 		if (data) {
 			this.setImageStatus(
-				fileData, Status.UPLOADED, 'ok', _('Image uploaded'));
+				fileData, Status.UPLOADED, 'cloud_done', _('Image uploaded'));
 		} else {
 			this.setImageStatus(
 				fileData, Status.NONE, 'error', error.message);
@@ -146,7 +146,7 @@ Hedera.Photos = new Class({
 		var statusNode = fileData.statusNode;
 		Vn.Node.removeChilds(statusNode);
 	
-		var iconNode = new Htk.Icon({icon: icon});
+		var iconNode = new Htk.Icon({name: icon});
 		statusNode.appendChild(iconNode.node);
 		statusNode.title = title ? title : '';
 	}
diff --git a/forms/admin/photos/style.css b/forms/admin/photos/style.css
index 3167f4ed..ca193e89 100644
--- a/forms/admin/photos/style.css
+++ b/forms/admin/photos/style.css
@@ -48,11 +48,11 @@
 }
 .photos .file-list .status {
 	cursor: pointer;
-	width: 1em;
+	width: 1.2em;
 	padding-left: .5em;
 	padding-right: .5em;
 }
-.photos .file-list .status > img {
+.photos .file-list .status > .htk-icon {
 	display: block;
 }
 .photos .file-list .htk-button {
diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js
index 0ad62275..19c4567a 100644
--- a/js/hedera/tpv.js
+++ b/js/hedera/tpv.js
@@ -14,7 +14,7 @@ module.exports = new Class({
 				transaction: this.tpvOrder,
 				status: this.tpvStatus
 			};
-			var query = 'CALL myTpvTransaction_end(#transaction, #status)';
+			const query = 'CALL myTpvTransaction_end(#transaction, #status)';
 			this.conn.execQuery(query, null, params);
 		}
 		
@@ -28,7 +28,7 @@ module.exports = new Class({
 
 	,_realPay: function(amount, company) {
 		if (isNumeric(amount) && amount > 0) {
-			var params = {
+			const params = {
 				 amount: parseInt(amount)
 				,urlOk: this._makeUrl('ok')
 				,urlKo: this._makeUrl('ko')
@@ -43,15 +43,15 @@ module.exports = new Class({
 
 	,_onTransactionStart: function(json) {
 		if (json) {
-			var postValues = json.postValues;
+			const postValues = json.postValues;
 
-			var form = document.createElement('form');
+			const form = document.createElement('form');
 			form.method = 'POST';
 			form.action = json.url;
 			document.body.appendChild(form);
 			
 			for (var field in postValues) {
-				var input = document.createElement('input');
+				const input = document.createElement('input');
 				input.type = 'hidden';
 				input.name = field;
 				form.appendChild(input);
@@ -68,7 +68,7 @@ module.exports = new Class({
 	,retryPay: function() {
 		const params = {transaction: parseInt(this.tpvOrder)};
 
-		var query = 'SELECT t.amount, m.companyFk '
+		const query = 'SELECT t.amount, m.companyFk '
 			+'FROM myTpvTransaction t '
 			+'JOIN tpvMerchant m ON m.id = t.merchantFk '
 				+'WHERE t.id = #transaction';
@@ -77,7 +77,7 @@ module.exports = new Class({
 	}
 	
 	,_onRetryPayDone: function(resultSet) {
-		var res = resultSet.fetchObject();
+		const res = resultSet.fetchObject();
 		
 		if (res)
 			this._realPay(res.amount, res.companyFk);
@@ -86,16 +86,18 @@ module.exports = new Class({
 	}
 
 	,_makeUrl: function(status) {
-		var path = location.protocol +'//'+ location.host;
+		let path = location.protocol +'//'+ location.hostname;
 		path += location.port ? ':'+ location.port : '';
 		path += location.pathname;
 		path += location.search ? location.search : '';
-		path += Vn.Hash.make({
+		path += this.hash.make({
 			form: 'ecomerce/orders',
 			tpvStatus: status,
 			tpvOrder: '_transactionId_'
 		}, true);
 
+		alert(path);
+
 		return path;
 	}
 });
diff --git a/js/vn/hash.js b/js/vn/hash.js
index 146bb690..d7f67ac6 100644
--- a/js/vn/hash.js
+++ b/js/vn/hash.js
@@ -47,7 +47,7 @@ module.exports = new Class({
 	 * @param {boolean} add %true to combine with the current params, %false otherwise
 	 * @return {string} The URL
 	 */
-	,make: function(params, add) {		
+	,make: function(params, add) {
 		if (add) {
 			params = Object.assign({}, params);
 
diff --git a/package.json b/package.json
index 633ba064..99269318 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "hedera-web",
-  "version": "1.408.12",
+  "version": "1.408.13",
   "description": "Verdnatura web page",
   "license": "GPL-3.0",
   "repository": {