From 5c05a2ef50f680683ec0622482fc8c7788e63eea Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 29 Nov 2017 13:55:51 +0100 Subject: [PATCH 01/35] Mailer bugs solved --- debian/changelog | 2 +- package.json | 2 +- rest/misc/mail.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index aa5e925b..966e2605 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.23) stable; urgency=low +hedera-web (1.405.24) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 66ca4f13..29a62535 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.23", + "version": "1.405.24", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/misc/mail.php b/rest/misc/mail.php index c6da11d5..3fb0c6f5 100755 --- a/rest/misc/mail.php +++ b/rest/misc/mail.php @@ -23,7 +23,7 @@ class Mail extends Vn\Lib\Method try { $mail = $mailer->createObject ($row->to, $row->text, $row->subject); - $mail->AddReplyTo ($row->reply_to, $conf->sender_name); + $mail->AddReplyTo ($row->reply_to, $row->reply_to); if (!empty ($row->path)) { @@ -47,7 +47,7 @@ class Mail extends Vn\Lib\Method } $db->query ('UPDATE mail SET sent = #, error = # WHERE id = #', - [$sent, $status, $row['id']]); + [$sent, $status, $row->id]); } $db->query ('COMMIT'); From fa4dd868625655641f0f995f74680fb22718bad5 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 1 Dec 2017 15:38:23 +0100 Subject: [PATCH 02/35] Tax and TPV bugs solved --- debian/changelog | 2 +- forms/ecomerce/confirm/confirm.js | 5 +--- forms/ecomerce/confirm/ui.xml | 14 +++++----- forms/ecomerce/orders/orders.js | 11 +++++--- js/hedera/tpv.js | 45 +++++++++++++++---------------- package.json | 2 +- pages/production/ui.php | 0 rest/tpv/transaction.php | 32 ++++++++++++---------- 8 files changed, 57 insertions(+), 54 deletions(-) create mode 100644 pages/production/ui.php diff --git a/debian/changelog b/debian/changelog index 966e2605..e8be1eef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.24) stable; urgency=low +hedera-web (1.405.25) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/confirm/confirm.js b/forms/ecomerce/confirm/confirm.js index 261c4cb9..1f510b0e 100644 --- a/forms/ecomerce/confirm/confirm.js +++ b/forms/ecomerce/confirm/confirm.js @@ -34,7 +34,7 @@ Hedera.Confirm = new Class Vn.Node.setText (this.$('method'), _('Warehouse')); } - var total = form.get ('tax_base') + form.get ('vat'); + var total = form.get ('taxBase') + form.get ('tax'); if (total === null) total = 0; @@ -149,10 +149,7 @@ Hedera.Confirm = new Class this.disableButtons (false); if (resultSet.fetchResult ()) - { - Vn.Cookie.unset ('order'); this.$('success-dialog').show (); - } } ,onDialogResponse: function () diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index a5026c86..54cc0894 100755 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -3,7 +3,7 @@ - CALL basket_get_vat (); + CALL basketGetTax; SELECT o.id, o.date_send, o.note, o.company_id, ag.description agency, v.code method, ad.consignee, ad.zip_code, ad.city, ad.name address, @@ -15,11 +15,11 @@ JOIN customer_view c JOIN ( SELECT - IFNULL(SUM(tax_base), 0) tax_base, - IFNULL(SUM(vat + surcharge), 0) vat - FROM t_order_vat + IFNULL(SUM(taxBase), 0) taxBase, + IFNULL(SUM(tax + equalizationTax), 0) tax + FROM tmp.orderTax ) t; - DROP TEMPORARY TABLE t_order_vat; + DROP TEMPORARY TABLE tmp.orderTax; @@ -76,7 +76,7 @@ Order total - + @@ -84,7 +84,7 @@ Order VAT - + diff --git a/forms/ecomerce/orders/orders.js b/forms/ecomerce/orders/orders.js index 1e4a6727..a4214ccd 100644 --- a/forms/ecomerce/orders/orders.js +++ b/forms/ecomerce/orders/orders.js @@ -41,17 +41,20 @@ Hedera.Orders = new Class ,onPayButtonClick: function () { var amount = -this.$('debt').value; - amount = amount <= 0 ? null : amount; var defaultAmountStr = ''; if (amount !== null) defaultAmountStr = Vn.Value.format (amount, '%.2d'); + + amount = prompt (_('AmountToPay:'), defaultAmountStr); - var amount = parseFloat (prompt (_('AmountToPay:'), defaultAmountStr)); - - this.tpv.pay (amount, null); + if (amount != null) + { + amount = parseFloat (amount.replace (',', '.')); + this.tpv.pay (amount, null); + } } ,onDialogResponse: function (dialog, response) diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js index ec276777..07c03365 100644 --- a/js/hedera/tpv.js +++ b/js/hedera/tpv.js @@ -27,24 +27,24 @@ module.exports = new Class ,pay: function (amount, company) { - this._realPpay (amount * 100, company); + this._realPay (amount * 100, company); } - ,_realPpay: function (amount, company) - { - if (amount > 0) + ,_realPay: function (amount, company) + { + if (isNumeric (amount) && amount > 0) { var params = { - 'amount': parseInt (amount) - ,'urlOk': this._makeUrl ('ok') - ,'urlKo': this._makeUrl ('ko') - ,'company': company + amount: parseInt (amount) + ,urlOk: this._makeUrl ('ok') + ,urlKo: this._makeUrl ('ko') + ,company: company }; this.conn.send ('tpv/transaction', params, this._onTransactionStart.bind (this)); } - else if (!isNaN (amount)) + else Htk.Toast.showError (_('AmountError')); } @@ -52,27 +52,22 @@ module.exports = new Class { if (json) { + var postValues = json.postValues; + var form = document.createElement ('form'); form.method = 'post'; form.action = json.url; document.body.appendChild (form); - var fieldsMap = - { - 'Ds_SignatureVersion': 'HMAC_SHA256_V1' - ,'Ds_MerchantParameters': json.params - ,'Ds_Signature': json.signature - }; - - for (var field in fieldsMap) + for (var field in postValues) { var input = document.createElement ('input'); input.type = 'hidden'; input.name = field; form.appendChild (input); - if (fieldsMap[field]) - input.value = fieldsMap[field]; + if (postValues[field]) + input.value = postValues[field]; } form.submit (); @@ -99,7 +94,7 @@ module.exports = new Class var res = resultSet.fetchResult (); if (res.next ()) - this._realPpay (res.get ('amount'), res.get ('company_id')); + this._realPay (res.get ('amount'), res.get ('company_id')); else Htk.Toast.showError (_('AmountError')); } @@ -111,12 +106,16 @@ module.exports = new Class path += location.pathname; path += location.search ? location.search : ''; path += Vn.Hash.make ({ - 'form': 'ecomerce/orders', - 'tpvStatus': status, - 'tpvOrder': '%s' + form: 'ecomerce/orders', + tpvStatus: status, + tpvOrder: '%s' }, true); return path; } }); +function isNumeric (n) +{ + return !isNaN (parseFloat(n)) && isFinite (n); +} diff --git a/package.json b/package.json index 29a62535..c009cd4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.24", + "version": "1.405.25", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/pages/production/ui.php b/pages/production/ui.php new file mode 100644 index 00000000..e69de29b diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php index c024869e..5a158898 100755 --- a/rest/tpv/transaction.php +++ b/rest/tpv/transaction.php @@ -2,7 +2,7 @@ /** * Starts a new TPV transaction and returns the params. - **/ + */ class Transaction extends Vn\Web\JsonRequest { const PARAMS = ['amount']; @@ -12,24 +12,24 @@ class Transaction extends Vn\Web\JsonRequest $amount = (int) $_REQUEST['amount']; $companyId = empty ($_REQUEST['company']) ? NULL : $_REQUEST['company']; - $row = $db->getRow ('CALL transactionStart (#, #)', + $row = $db->getObject ('CALL transactionStart (#, #)', [$amount, $companyId]); if (!isset ($row)) throw new Exception ('Transaction error'); - $transactionId = str_pad ($row['transactionId'], 12, '0', STR_PAD_LEFT); + $transactionId = str_pad ($row->transactionId, 12, '0', STR_PAD_LEFT); $urlOk = empty ($_REQUEST['urlOk']) ? '' : sprintf ($_REQUEST['urlOk'], $transactionId); $urlKo = empty ($_REQUEST['urlKo']) ? '' : sprintf ($_REQUEST['urlKo'], $transactionId); - $merchantUrl = $row['merchantUrl'] ? $row['merchantUrl'] : ''; + $merchantUrl = $row->merchantUrl ? $row->merchantUrl : ''; $params = [ 'Ds_Merchant_Amount' => $amount ,'Ds_Merchant_Order' => $transactionId - ,'Ds_Merchant_MerchantCode' => $row['merchant'] - ,'Ds_Merchant_Currency' => $row['currency'] - ,'Ds_Merchant_TransactionType' => $row['transactionType'] - ,'Ds_Merchant_Terminal' => $row['terminal'] + ,'Ds_Merchant_MerchantCode' => $row->merchant + ,'Ds_Merchant_Currency' => $row->currency + ,'Ds_Merchant_TransactionType' => $row->transactionType + ,'Ds_Merchant_Terminal' => $row->terminal ,'Ds_Merchant_MerchantURL' => $merchantUrl ,'Ds_Merchant_UrlOK' => $urlOk ,'Ds_Merchant_UrlKO' => $urlKo @@ -37,20 +37,24 @@ class Transaction extends Vn\Web\JsonRequest $encodedParams = base64_encode (json_encode ($params)); - $key = base64_decode ($row['secretKey']); + $key = base64_decode ($row->secretKey); $bytes = [0, 0, 0, 0, 0, 0, 0, 0]; $iv = implode (array_map ('chr', $bytes)); $key = mcrypt_encrypt (MCRYPT_3DES, $key, $transactionId, MCRYPT_MODE_CBC, $iv); $signature = base64_encode (hash_hmac ('sha256', $encodedParams, $key, TRUE)); - $url = $row['url']; + + $url = $row->url; + $postValues = [ + 'Ds_SignatureVersion' => 'HMAC_SHA256_V1' + ,'Ds_MerchantParameters' => $encodedParams + ,'Ds_Signature' => $signature + ]; return [ - 'url' => $url - ,'params' => $encodedParams - ,'signature' => $signature + 'url' => $url + ,'postValues' => $postValues ]; } } - From 3032850d58bb3a1ba67f6ba5096e89b973b07972 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 4 Dec 2017 19:22:58 +0100 Subject: [PATCH 03/35] Page to display production routes, bugs solved --- debian/changelog | 2 +- package.json | 2 +- pages/production/main.js | 120 ++++++++++++++++++++++++++++++++++++ pages/production/style.css | 61 ++++++++++++++++++ pages/production/ui.php | 30 +++++++++ pages/update-browser/ui.php | 4 +- pages/version-menu/ui.php | 2 +- rest/core/account.php | 1 - rest/misc/production.php | 19 ++++++ web/html-service.php | 3 +- web/html.php | 6 +- 11 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 pages/production/main.js create mode 100644 pages/production/style.css create mode 100644 rest/misc/production.php diff --git a/debian/changelog b/debian/changelog index e8be1eef..fee3a56f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.25) stable; urgency=low +hedera-web (1.405.26) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index c009cd4b..6fd0f08e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.25", + "version": "1.405.26", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/pages/production/main.js b/pages/production/main.js new file mode 100644 index 00000000..d48c53e0 --- /dev/null +++ b/pages/production/main.js @@ -0,0 +1,120 @@ + +/** + * Time in seconds between every request. + */ +var INTERVAL = 5; + +var requestInterval = INTERVAL; +var timeoutId = null; +var request = null; + +function onSettingsClick () +{ + var deviceId = localStorage.getItem ('hederaDeviceId'); + + if (deviceId == null) + deviceId = ''; + + deviceId = prompt ('Enter the device identifier', deviceId); + + if (deviceId) + localStorage.setItem ('hederaDeviceId', deviceId); + else if (deviceId === '') + localStorage.removeItem ('hederaDeviceId'); + + if (timeoutId != null) + { + clearTimeout (timeoutId); + timeoutId = null; + } + if (request) + { + request.abort (); + request = null; + } + + updateText (); +} + +function onBodyLoad () +{ + updateText (); +} + +function updateText () +{ + var deviceId = localStorage.getItem ('hederaDeviceId'); + + if (!deviceId) + { + display ('Device id not set', true); + return; + } + + var formData = new FormData (); + formData.append ('srv', 'json:misc/production'); + formData.append ('deviceId', deviceId); + + request = new XMLHttpRequest(); + request.open ('post', '', true); + request.onreadystatechange = + onRequestChange.bind (null, request); + request.send (formData); +} + +function onRequestChange (request) +{ + if (request.readyState !== 4) + return; + + try { + switch (request.status) + { + case 200: + var json = JSON.parse (request.responseText); + display (json.data); + requestInterval = INTERVAL; + break; + case 400: + var json = JSON.parse (request.responseText); + throw new Error (json.data.message); + default: + throw new Error ('HTTP '+ request.status +': '+ request.statusText); + } + } + catch (e) + { + display (e.message, true); + console.error (e.message); + + if (requestInterval < 60) + { + requestInterval += parseInt (Math.random() * 10) + 1; + console.warn ('Request interval increased to %d seconds.', requestInterval); + } + } + + timeoutId = setTimeout (updateText, requestInterval * 1000); + request = null; +} + +function display (text, error) +{ + if (!error) + { + $('text').textContent = text; + $('error').textContent = ''; + $('error').style.display = 'none'; + } + else + { + $('text').textContent = 'Er'; + $('error').textContent = text; + $('error').style.display = 'block'; + } +} + +function $ (elementId) +{ + return document.getElementById (elementId); +} diff --git a/pages/production/style.css b/pages/production/style.css new file mode 100644 index 00000000..2c424c77 --- /dev/null +++ b/pages/production/style.css @@ -0,0 +1,61 @@ +body +{ + background-color: #333; + position: absolute; + height: 100%; + width: 100%; + margin: 0; + font-family: Sans; +} +#container +{ + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} +#child +{ + max-width: 90%; + text-align: center; +} +#text +{ + color: white; + font-size: 20em; + text-align: center; + font-weight: bold; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} +#error +{ + color: red; + font-size: 3em; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} +button +{ + position: fixed; + margin: 1em; + padding: 1em; + top: 0; + right: 0; + background-color: transparent; + border: none; + cursor: pointer; +} +button:hover +{ + background-color: rgba(0, 0, 0, 0.4); + border-radius: .2em; +} +button > img +{ + height: 3em; + display: block; +} \ No newline at end of file diff --git a/pages/production/ui.php b/pages/production/ui.php index e69de29b..3a0c8897 100644 --- a/pages/production/ui.php +++ b/pages/production/ui.php @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + Production + + + +
+
+
Hi!
+
+
+
+ + \ No newline at end of file diff --git a/pages/update-browser/ui.php b/pages/update-browser/ui.php index 62f59301..cdf53f03 100755 --- a/pages/update-browser/ui.php +++ b/pages/update-browser/ui.php @@ -3,8 +3,8 @@ - - + + Verdnatura diff --git a/pages/version-menu/ui.php b/pages/version-menu/ui.php index 2e8c5a41..9e7665ca 100755 --- a/pages/version-menu/ui.php +++ b/pages/version-menu/ui.php @@ -4,7 +4,7 @@ - + Verdnatura diff --git a/rest/core/account.php b/rest/core/account.php index c924b823..f902bcc3 100755 --- a/rest/core/account.php +++ b/rest/core/account.php @@ -233,7 +233,6 @@ class SshConnection $args[$i] = self::escape ($args[$i]); $command = call_user_func_array ('sprintf', $args); - error_log ($command); return ssh2_exec ($this->connection, $command); } diff --git a/rest/misc/production.php b/rest/misc/production.php new file mode 100644 index 00000000..18bf548d --- /dev/null +++ b/rest/misc/production.php @@ -0,0 +1,19 @@ +getObject ( + 'SELECT displayText FROM production WHERE deviceId = #', + [$_REQUEST['deviceId']] + ); + + if (!isset($row)) + throw new Vn\Lib\UserException ('Device not found'); + + return $row->displayText; + } +} diff --git a/web/html-service.php b/web/html-service.php index 1600ee7d..1497e8b0 100644 --- a/web/html-service.php +++ b/web/html-service.php @@ -2,8 +2,6 @@ namespace Vn\Web; -require_once __DIR__.'/html.php'; - use Vn\Lib\Locale; /** @@ -92,6 +90,7 @@ class HtmlService extends Service $this->printHeader (); $dir = $basePath; + include_once __DIR__.'/html.php'; include ("./$basePath/ui.php"); } else diff --git a/web/html.php b/web/html.php index 5f1df6dc..39414add 100644 --- a/web/html.php +++ b/web/html.php @@ -1,11 +1,13 @@ getVersion(); + function getUrl ($fileName) { if (file_exists ($fileName)) - $mTime = '?'. strftime ('%G%m%d%H%M%S', filemtime ($fileName)); + $mTime = '?'. strftime ('%G%m%d%H%M%S', filemtime ($fileName)); else - $mTime = '?'. $this->getVersion (); + $mTime = '?'. $this->getVersion (); return $fileName.$mTime; } From a0cf0fe0dde00ebe497eefea6a882cda6b9db2b0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 5 Dec 2017 12:49:05 +0100 Subject: [PATCH 04/35] LDAP sync bugs solved, production bugs solved --- debian/changelog | 2 +- js/vn/json-connection.js | 18 ++--- package.json | 2 +- pages/production/main.js | 17 ++-- pages/production/style.css | 2 +- pages/production/ui.php | 10 +-- pages/update-browser/ui.php | 3 +- pages/version-menu/ui.php | 3 +- rest/core/account.php | 150 +++++++++++++++++++++--------------- web/html.php | 7 +- 10 files changed, 124 insertions(+), 90 deletions(-) diff --git a/debian/changelog b/debian/changelog index fee3a56f..4deef374 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.26) stable; urgency=low +hedera-web (1.405.27) stable; urgency=low * Initial Release. diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index 4b583e73..ffd4912a 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -54,9 +54,9 @@ module.exports = new Class if (user !== null && user !== undefined) { var params = { - 'user': user - ,'password': pass - ,'remember': remember + user: user + ,password: pass + ,remember: remember }; } else @@ -125,7 +125,7 @@ module.exports = new Class **/ ,supplantUser: function (user, callback) { - var params = {'supplantUser': user}; + var params = {supplantUser: user}; this.send ('core/supplant', params, this._onUserSupplant.bind (this, callback)); } @@ -160,9 +160,9 @@ module.exports = new Class if (!params) params = {}; - params['srv'] = 'json:'+ restService; + params.srv = 'json:'+ restService; - this.sendWithUrl (params, callback, 'post', '.'); + this.sendWithUrl (params, callback, 'POST', '.'); } ,sendForm: function (form, callback) @@ -174,7 +174,7 @@ module.exports = new Class if (elements[i].name) params[elements[i].name] = elements[i].value; - this.sendWithUrl (params, callback, 'post', form.action); + this.sendWithUrl (params, callback, 'POST', form.action); } ,sendFormMultipart: function (form, callback) @@ -185,7 +185,7 @@ module.exports = new Class formData.append ('token', this.token); var request = new XMLHttpRequest (); - request.open ('post', form.action, true); + request.open ('POST', form.action, true); request.onreadystatechange = this._onStateChange.bind (this, request, callback); request.send (formData); @@ -199,7 +199,7 @@ module.exports = new Class formData.append ('token', this.token); var request = new XMLHttpRequest (); - request.open ('post', '', true); + request.open ('POST', '', true); request.onreadystatechange = this._onStateChange.bind (this, request, callback); request.send (formData); diff --git a/package.json b/package.json index 6fd0f08e..d219f4ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.26", + "version": "1.405.27", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/pages/production/main.js b/pages/production/main.js index d48c53e0..f776ecfb 100644 --- a/pages/production/main.js +++ b/pages/production/main.js @@ -5,9 +5,15 @@ var INTERVAL = 5; var requestInterval = INTERVAL; +var failedRequests = 0; var timeoutId = null; var request = null; +function onBodyLoad () +{ + updateText (); +} + function onSettingsClick () { var deviceId = localStorage.getItem ('hederaDeviceId'); @@ -36,11 +42,6 @@ function onSettingsClick () updateText (); } -function onBodyLoad () -{ - updateText (); -} - function updateText () { var deviceId = localStorage.getItem ('hederaDeviceId'); @@ -56,7 +57,7 @@ function updateText () formData.append ('deviceId', deviceId); request = new XMLHttpRequest(); - request.open ('post', '', true); + request.open ('POST', '', true); request.onreadystatechange = onRequestChange.bind (null, request); request.send (formData); @@ -74,6 +75,7 @@ function onRequestChange (request) var json = JSON.parse (request.responseText); display (json.data); requestInterval = INTERVAL; + failedRequests = 0; break; case 400: var json = JSON.parse (request.responseText); @@ -86,8 +88,9 @@ function onRequestChange (request) { display (e.message, true); console.error (e.message); + failedRequests++; - if (requestInterval < 60) + if (failedRequests > 10 && requestInterval < 60) { requestInterval += parseInt (Math.random() * 10) + 1; console.warn ('Request interval increased to %d seconds.', requestInterval); diff --git a/pages/production/style.css b/pages/production/style.css index 2c424c77..7ca55cda 100644 --- a/pages/production/style.css +++ b/pages/production/style.css @@ -23,7 +23,7 @@ body #text { color: white; - font-size: 20em; + font-size: 15em; text-align: center; font-weight: bold; text-overflow: ellipsis; diff --git a/pages/production/ui.php b/pages/production/ui.php index 3a0c8897..54c6b119 100644 --- a/pages/production/ui.php +++ b/pages/production/ui.php @@ -4,16 +4,14 @@ + + - - - - - - + + Production diff --git a/pages/update-browser/ui.php b/pages/update-browser/ui.php index cdf53f03..49e6e1f5 100755 --- a/pages/update-browser/ui.php +++ b/pages/update-browser/ui.php @@ -3,8 +3,9 @@ + - + Verdnatura diff --git a/pages/version-menu/ui.php b/pages/version-menu/ui.php index 9e7665ca..12be46ae 100755 --- a/pages/version-menu/ui.php +++ b/pages/version-menu/ui.php @@ -3,8 +3,9 @@ + - + Verdnatura diff --git a/rest/core/account.php b/rest/core/account.php index f902bcc3..17403c97 100755 --- a/rest/core/account.php +++ b/rest/core/account.php @@ -42,9 +42,6 @@ class Account */ static function ldapSync ($db, $userName, $password) { - if (empty ($password)) - return; - // Gets LDAP configuration parameters $conf = $db->getObject ( @@ -58,81 +55,114 @@ class Account if (!$ds) throw new Exception ("Can't connect to LDAP server: ". ldapError ($ds)); - ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - $bind = ldap_bind ($ds, $conf->rdn, base64_decode ($conf->password)); + try { + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + $bind = ldap_bind ($ds, $conf->rdn, base64_decode ($conf->password)); - if (!$bind) - throw new Exception ("Authentication failed on LDAP server: ". ldapError ($ds)); + if (!$bind) + throw new Exception ("Authentication failed on LDAP server: ". ldapError ($ds)); - // Prepares the data + // Prepares the data - $domain = $db->getValue ('SELECT domain FROM account.mailConfig'); + $domain = $db->getValue ('SELECT domain FROM account.mailConfig'); - $user = $db->getObject ( - 'SELECT id, nickname, lang - FROM account.user - WHERE name = #', - [$userName] - ); + $user = $db->getObject ( + 'SELECT id, nickname, lang + FROM account.user + WHERE name = #', + [$userName] + ); - $nameArgs = explode (' ', $user->nickname); - $givenName = $nameArgs[0]; + $cn = empty ($user->nickname) ? $userName : $user->nickname; - if (count ($nameArgs) > 1) - $sn = $nameArgs[1]; - if (empty ($sn)) - $sn = 'Empty'; + $nameArgs = explode (' ', $user->nickname); + $givenName = $nameArgs[0]; - $info = [ - 'cn' => $user->nickname, - 'displayName' => $user->nickname, - 'givenName' => $givenName, - 'sn' => $sn, - 'mail' => "$userName@{$domain}", - 'userPassword' => sshaEncode ($password), - 'preferredLanguage' => $user->lang - ]; + if (count ($nameArgs) > 1) + $sn = $nameArgs[1]; + if (empty ($sn)) + $sn = 'Empty'; - // Search the user entry + $attrs = [ + 'cn' => $cn, + 'displayName' => $user->nickname, + 'givenName' => $givenName, + 'sn' => $sn, + 'mail' => "$userName@{$domain}", + 'userPassword' => sshaEncode ($password), + 'preferredLanguage' => $user->lang + ]; - $filter = "uid=$userName"; + // Search the user entry - if (!empty($conf->filter)) - $filter = "(&($filter)($conf->filter))"; + $filter = "uid=$userName"; - $res = ldap_search ($ds, $conf->baseDn, $filter); + if (!empty($conf->filter)) + $filter = "(&($filter)($conf->filter))"; - if (!$res) - throw new Exception ("Can't get the LDAP entry: ". ldapError ($ds)); + $res = ldap_search ($ds, $conf->baseDn, $filter); - $dn = "uid=$userName,{$conf->baseDn}"; - $entry = ldap_first_entry ($ds, $res); + if (!$res) + throw new Exception ("Can't get the LDAP entry: ". ldapError ($ds)); - $classes = ldap_get_values ($ds, $entry, 'objectClass'); + $dn = "uid=$userName,{$conf->baseDn}"; + $entry = ldap_first_entry ($ds, $res); - if (!in_array ('inetOrgPerson', $classes)) - { - ldap_delete ($ds, $dn); - $entry = NULL; + $classes = ldap_get_values ($ds, $entry, 'objectClass'); + + if (!in_array ('inetOrgPerson', $classes)) + { + ldap_delete ($ds, $dn); + $entry = NULL; + } + + if ($entry) + { + $modifs = []; + $curAttrs = ldap_get_attributes ($ds, $entry); + + foreach ($attrs as $attribute => $value) + if (!empty ($value)) + { + $modifs[] = [ + 'attrib' => $attribute, + 'modtype' => LDAP_MODIFY_BATCH_REPLACE, + 'values' => [$value] + ]; + } + elseif (isset ($curAttrs[$attribute])) + { + $modifs[] = [ + 'attrib' => $attribute, + 'modtype' => LDAP_MODIFY_BATCH_REMOVE_ALL + ]; + } + + $updated = ldap_modify_batch ($ds, $dn, $modifs); + } + else + { + $addAttrs = []; + + foreach ($attrs as $attribute => $value) + if (!empty ($value)) + $addAttrs[$attribute] = $value; + + $addAttrs = array_merge ($addAttrs, [ + 'objectClass' => ['inetOrgPerson'], + 'uid' => $userName + ]); + $updated = ldap_add ($ds, $dn, $addAttrs); + } + + if (!$updated) + throw new Exception ("Can't update the LDAP entry: ". ldapError ($ds)); } - - if ($entry) + catch (Exception $e) { - $updated = ldap_modify ($ds, $dn, $info); + ldap_unbind ($ds); + throw $e; } - else - { - $info = array_merge ($info, [ - 'objectClass' => ['inetOrgPerson'], - 'uid' => $userName - ]); - $updated = ldap_add ($ds, $dn, $info); - } - - if (!$updated) - throw new Exception ("Can't update the LDAP entry: ". ldapError ($ds)); - - ldap_unbind ($ds); } /** diff --git a/web/html.php b/web/html.php index 39414add..f18b6e1b 100644 --- a/web/html.php +++ b/web/html.php @@ -1,15 +1,16 @@ getVersion(); function getUrl ($fileName) { if (file_exists ($fileName)) - $mTime = '?'. strftime ('%G%m%d%H%M%S', filemtime ($fileName)); + $fileVersion = strftime ('%G%m%d%H%M%S', filemtime ($fileName)); else - $mTime = '?'. $this->getVersion (); + $fileVersion = $version; - return $fileName.$mTime; + return "$fileName?$fileVersion"; } function js ($fileName) From 41c7369232b7a2d355bc7598bcc9db5cceeb1fa4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 5 Dec 2017 13:59:22 +0100 Subject: [PATCH 05/35] Bug fixes --- debian/changelog | 2 +- debian/install | 1 - package.json | 2 +- manifest.json => pages/main/manifest.json | 4 ++-- pages/main/ui.php | 2 +- pages/production/main.js | 2 +- pages/production/manifest.json | 11 +++++++++++ pages/production/style.css | 6 +++--- pages/production/ui.php | 2 +- 9 files changed, 21 insertions(+), 11 deletions(-) rename manifest.json => pages/main/manifest.json (57%) create mode 100644 pages/production/manifest.json diff --git a/debian/changelog b/debian/changelog index 4deef374..78349de3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.27) stable; urgency=low +hedera-web (1.405.31) stable; urgency=low * Initial Release. diff --git a/debian/install b/debian/install index be45025c..7e79b186 100644 --- a/debian/install +++ b/debian/install @@ -11,7 +11,6 @@ rest usr/share/hedera-web index.php usr/share/hedera-web package.json usr/share/hedera-web build usr/share/hedera-web -manifest.json usr/share/hedera-web LICENSE usr/share/hedera-web README.md usr/share/hedera-web webpack.config.json usr/share/hedera-web diff --git a/package.json b/package.json index d219f4ac..8a850a60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.27", + "version": "1.405.31", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/manifest.json b/pages/main/manifest.json similarity index 57% rename from manifest.json rename to pages/main/manifest.json index e1b6b274..ccfa40bb 100644 --- a/manifest.json +++ b/pages/main/manifest.json @@ -2,10 +2,10 @@ "name": "Verdnatura", "icons": [ { - "src": "image\/favicon\/favicon.png", + "src": "\/image\/favicon\/favicon.png", "sizes": "512x512" } ], - "start_url": "index.php", + "start_url": "/index.php", "display": "standalone" } diff --git a/pages/main/ui.php b/pages/main/ui.php index 65a7a283..9d842d74 100755 --- a/pages/main/ui.php +++ b/pages/main/ui.php @@ -14,7 +14,7 @@ $result = $db->query ('SELECT name, content FROM metatag'); - + diff --git a/pages/production/main.js b/pages/production/main.js index f776ecfb..845b65e0 100644 --- a/pages/production/main.js +++ b/pages/production/main.js @@ -2,7 +2,7 @@ /** * Time in seconds between every request. */ -var INTERVAL = 5; +var INTERVAL = 10; var requestInterval = INTERVAL; var failedRequests = 0; diff --git a/pages/production/manifest.json b/pages/production/manifest.json new file mode 100644 index 00000000..95c5a691 --- /dev/null +++ b/pages/production/manifest.json @@ -0,0 +1,11 @@ +{ + "name": "Production", + "icons": [ + { + "src": "\/image\/favicon\/favicon.png", + "sizes": "512x512" + } + ], + "start_url": "/index.php?method=production", + "display": "standalone" +} diff --git a/pages/production/style.css b/pages/production/style.css index 7ca55cda..186fae79 100644 --- a/pages/production/style.css +++ b/pages/production/style.css @@ -23,12 +23,12 @@ body #text { color: white; - font-size: 15em; - text-align: center; + font-size: 24em; font-weight: bold; - text-overflow: ellipsis; + text-align: center; white-space: nowrap; overflow: hidden; + line-height: 1em; } #error { diff --git a/pages/production/ui.php b/pages/production/ui.php index 54c6b119..249f9603 100644 --- a/pages/production/ui.php +++ b/pages/production/ui.php @@ -9,7 +9,7 @@ - + Production From 586eaab2551894d9be738670cc180b76e98b5135 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 6 Dec 2017 16:23:12 +0100 Subject: [PATCH 06/35] Translations fixed --- debian/changelog | 2 +- forms/ecomerce/orders/locale/ca.json | 1 - forms/ecomerce/orders/locale/en.json | 1 - forms/ecomerce/orders/locale/es.json | 1 - forms/ecomerce/orders/locale/fr.json | 3 +-- forms/ecomerce/orders/locale/mn.json | 1 - forms/ecomerce/orders/locale/pt.json | 1 - forms/ecomerce/ticket/locale/fr.json | 2 +- package.json | 2 +- 9 files changed, 4 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 78349de3..229e3f33 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.31) stable; urgency=low +hedera-web (1.405.32) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/orders/locale/ca.json b/forms/ecomerce/orders/locale/ca.json index d17fe4fd..a20fe3d2 100755 --- a/forms/ecomerce/orders/locale/ca.json +++ b/forms/ecomerce/orders/locale/ca.json @@ -26,7 +26,6 @@ ,"Consignee": "Consignatari" ,"Boxes": "Caixes" ,"TotalWithVAT": "Total amb IVA" - ,"Pending": "Pendent" ,"PayOrder": "Pagar encàrrec" ,"AmountToPay:": "Quantitat a pagar (€):" diff --git a/forms/ecomerce/orders/locale/en.json b/forms/ecomerce/orders/locale/en.json index 49ea44b6..cb586a8e 100755 --- a/forms/ecomerce/orders/locale/en.json +++ b/forms/ecomerce/orders/locale/en.json @@ -26,7 +26,6 @@ ,"Consignee": "Consignee" ,"Boxes": "Bundles" ,"TotalWithVAT": "Total with VAT" - ,"Pending": "Pending" ,"PayOrder": "Pay order" ,"AmountToPay:": "Amount to pay (€):" diff --git a/forms/ecomerce/orders/locale/es.json b/forms/ecomerce/orders/locale/es.json index edf69c75..f03ad431 100755 --- a/forms/ecomerce/orders/locale/es.json +++ b/forms/ecomerce/orders/locale/es.json @@ -26,7 +26,6 @@ ,"Consignee": "Consignatario" ,"Boxes": "Bultos" ,"TotalWithVAT": "Total con IVA" - ,"Pending": "Pendiente" ,"PayOrder": "Pagar pedido" ,"AmountToPay:": "Cantidad a pagar (€):" diff --git a/forms/ecomerce/orders/locale/fr.json b/forms/ecomerce/orders/locale/fr.json index dcb046d3..e37ed811 100755 --- a/forms/ecomerce/orders/locale/fr.json +++ b/forms/ecomerce/orders/locale/fr.json @@ -20,13 +20,12 @@ ,"ShoppingBasket": "Panier" ,"SeeOrder": "Votre panier" - ,"Delivery": "Accouchement" + ,"Delivery": "Livraison" ,"TicketNumber": "Numéro ticket" ,"SentAddress": "Adresse de livraison" ,"Consignee": "Destinataire" ,"Boxes": "Colis" ,"TotalWithVAT": "Total avec TVA" - ,"Pending": "En attente" ,"PayOrder": "Payer la commande" ,"AmountToPay:": "Montant à payer (€):" diff --git a/forms/ecomerce/orders/locale/mn.json b/forms/ecomerce/orders/locale/mn.json index 3e194aff..887a95d1 100755 --- a/forms/ecomerce/orders/locale/mn.json +++ b/forms/ecomerce/orders/locale/mn.json @@ -26,7 +26,6 @@ ,"Consignee": "Consignee" ,"Boxes": "Bundles" ,"TotalWithVAT": "Total with VAT" - ,"Pending": "Pending" ,"PayOrder": "Pay order" ,"AmountToPay:": "Amount to pay (€):" diff --git a/forms/ecomerce/orders/locale/pt.json b/forms/ecomerce/orders/locale/pt.json index 65daa841..5768c6b6 100644 --- a/forms/ecomerce/orders/locale/pt.json +++ b/forms/ecomerce/orders/locale/pt.json @@ -26,7 +26,6 @@ ,"Consignee": "Consignatario" ,"Boxes": "Bultos" ,"TotalWithVAT": "Total com IVA" - ,"Pending": "Pendente" ,"PayOrder": "Pagar pedido" ,"AmountToPay:": "Quantidade a pagar (€):" diff --git a/forms/ecomerce/ticket/locale/fr.json b/forms/ecomerce/ticket/locale/fr.json index 4a3764a1..4f30ab04 100755 --- a/forms/ecomerce/ticket/locale/fr.json +++ b/forms/ecomerce/ticket/locale/fr.json @@ -3,7 +3,7 @@ ,"Print delivery note": "Imprimer bulletin de livraison" - ,"Delivery": "Accouchement" + ,"Delivery": "Livraison" ,"Total": "Total" ,"Tax base": "Imposable" ,"VAT": "TVA" diff --git a/package.json b/package.json index 8a850a60..c8b0e9a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.31", + "version": "1.405.32", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 0a14770ab64b808def316a806dcdc2b138856cbd Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 09:38:25 +0100 Subject: [PATCH 07/35] Producion effects --- .eslintrc.yml | 8 ++++++++ debian/changelog | 2 +- js/hedera/tpv.js | 6 +++--- package.json | 2 +- pages/production/main.js | 23 +++++++++++++++++++++++ pages/production/style.css | 1 + rest/dms/add.php | 2 +- 7 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..0fe49c2b --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,8 @@ +extends: eslint:recommended +rules: + no-undef: 0 + no-redeclare: 0 + no-mixed-spaces-and-tabs: 0 + no-console: 0 + no-cond-assign: 0 + no-unexpected-multiline: 0 \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 229e3f33..dc948360 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.32) stable; urgency=low +hedera-web (1.405.34) stable; urgency=low * Initial Release. diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js index 07c03365..ffdf6495 100644 --- a/js/hedera/tpv.js +++ b/js/hedera/tpv.js @@ -48,14 +48,14 @@ module.exports = new Class Htk.Toast.showError (_('AmountError')); } - ,_onTransactionStart: function (json, error) + ,_onTransactionStart: function (json) { if (json) { var postValues = json.postValues; var form = document.createElement ('form'); - form.method = 'post'; + form.method = 'POST'; form.action = json.url; document.body.appendChild (form); @@ -99,7 +99,7 @@ module.exports = new Class Htk.Toast.showError (_('AmountError')); } - ,_makeUrl: function (status, order) + ,_makeUrl: function (status) { var path = location.protocol +'//'+ location.host; path += location.port ? ':'+ location.port : ''; diff --git a/package.json b/package.json index c8b0e9a9..49bb477d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.32", + "version": "1.405.34", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/pages/production/main.js b/pages/production/main.js index 845b65e0..3cbb71b3 100644 --- a/pages/production/main.js +++ b/pages/production/main.js @@ -8,6 +8,8 @@ var requestInterval = INTERVAL; var failedRequests = 0; var timeoutId = null; var request = null; +var lastText = null; +var lastError = null; function onBodyLoad () { @@ -103,18 +105,39 @@ function onRequestChange (request) function display (text, error) { + var bgColor; + if (!error) { $('text').textContent = text; $('error').textContent = ''; $('error').style.display = 'none'; + bgColor = 'green'; } else { $('text').textContent = 'Er'; $('error').textContent = text; $('error').style.display = 'block'; + bgColor = 'red'; } + + if (text != lastText || lastError != error) + { + var body = document.body; + body.addEventListener ('transitionend', onTransitionEnd); + body.style.backgroundColor = bgColor; + } + + lastText = text; + lastError = error; +} + +function onTransitionEnd () +{ + var body = document.body; + body.removeEventListener ('transitionend', onTransitionEnd); + body.style.backgroundColor = ''; } function $ (elementId) diff --git a/pages/production/style.css b/pages/production/style.css index 186fae79..d5beb353 100644 --- a/pages/production/style.css +++ b/pages/production/style.css @@ -6,6 +6,7 @@ body width: 100%; margin: 0; font-family: Sans; + transition: background-color 500ms ease-in; } #container { diff --git a/rest/dms/add.php b/rest/dms/add.php index 19a51740..81b00ce9 100644 --- a/rest/dms/add.php +++ b/rest/dms/add.php @@ -33,7 +33,7 @@ class Add extends Vn\Web\JsonRequest $maxSize = $db->getValue ('SELECT max_size FROM dms_config'); if ($_FILES['doc']['size'] > $maxSize * 1048576) - throw new Lib\UserException (sprintf ('File size exceeds size: %d MB', $maxSize))); + throw new Lib\UserException (sprintf ('File size exceeds size: %d MB', $maxSize)); try { // Registers the document in the database From 0e3392cee35f7a38b86458006f876a5845a92f6a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 09:41:57 +0100 Subject: [PATCH 08/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc948360..f61f537c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.34) stable; urgency=low +hedera-web (1.405.35) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 49bb477d..20f94903 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.34", + "version": "1.405.35", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From e002677d0b5f04e86f104abd579a1140b9457b8d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 09:45:04 +0100 Subject: [PATCH 09/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f61f537c..ae969c89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.35) stable; urgency=low +hedera-web (1.405.36) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 20f94903..88d5af9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.35", + "version": "1.405.36", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 4fecd778decf780b5e1ce87f49e9db21dcd3e4c4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 12:46:36 +0100 Subject: [PATCH 10/35] Lintian warnings --- LICENSE | 0 conf/apache.conf | 15 +++------------ conf/config.php | 0 debian/cron.d | 0 forms/account/address-list/locale/ca.json | 0 forms/account/address-list/locale/en.json | 0 forms/account/address-list/locale/es.json | 0 forms/account/address-list/locale/fr.json | 0 forms/account/address-list/locale/mn.json | 0 forms/account/address-list/ui.xml | 0 forms/account/address/locale/ca.json | 0 forms/account/address/locale/en.json | 0 forms/account/address/locale/es.json | 0 forms/account/address/locale/fr.json | 0 forms/account/address/locale/mn.json | 0 forms/account/address/ui.xml | 0 forms/account/conf/locale/ca.json | 0 forms/account/conf/locale/en.json | 0 forms/account/conf/locale/es.json | 0 forms/account/conf/locale/fr.json | 0 forms/account/conf/locale/mn.json | 0 forms/account/conf/ui.xml | 0 forms/admin/access-log/ui.xml | 0 forms/admin/connections/locale/ca.json | 0 forms/admin/connections/locale/en.json | 0 forms/admin/connections/locale/es.json | 0 forms/admin/connections/locale/fr.json | 0 forms/admin/connections/locale/mn.json | 0 forms/admin/connections/locale/pt.json | 0 forms/admin/connections/ui.xml | 0 forms/admin/items/locale/ca.json | 0 forms/admin/items/locale/en.json | 0 forms/admin/items/locale/es.json | 0 forms/admin/items/locale/fr.json | 0 forms/admin/items/locale/mn.json | 0 forms/admin/items/ui.xml | 0 forms/admin/links/locale/ca.json | 0 forms/admin/links/locale/en.json | 0 forms/admin/links/locale/es.json | 0 forms/admin/links/locale/fr.json | 0 forms/admin/links/locale/mn.json | 0 forms/admin/links/ui.xml | 0 forms/admin/photos/locale/ca.json | 0 forms/admin/photos/locale/en.json | 0 forms/admin/photos/locale/es.json | 0 forms/admin/photos/locale/fr.json | 0 forms/admin/photos/locale/mn.json | 0 forms/admin/photos/ui.xml | 0 forms/admin/queries/locale/ca.json | 0 forms/admin/queries/locale/en.json | 0 forms/admin/queries/locale/es.json | 0 forms/admin/queries/locale/fr.json | 0 forms/admin/queries/locale/mn.json | 0 forms/admin/queries/locale/pt.json | 0 forms/admin/queries/ui.xml | 0 forms/admin/users/locale/ca.json | 0 forms/admin/users/locale/en.json | 0 forms/admin/users/locale/es.json | 0 forms/admin/users/locale/fr.json | 0 forms/admin/users/locale/mn.json | 0 forms/admin/users/ui.xml | 0 forms/admin/visits/locale/ca.json | 0 forms/admin/visits/locale/en.json | 0 forms/admin/visits/locale/es.json | 0 forms/admin/visits/locale/fr.json | 0 forms/admin/visits/locale/mn.json | 0 forms/admin/visits/locale/pt.json | 0 forms/admin/visits/ui.xml | 0 forms/agencies/packages/locale/ca.json | 0 forms/agencies/packages/locale/en.json | 0 forms/agencies/packages/locale/es.json | 0 forms/agencies/packages/locale/fr.json | 0 forms/agencies/packages/locale/mn.json | 0 forms/agencies/packages/ui.xml | 0 forms/agencies/provinces/locale/ca.json | 0 forms/agencies/provinces/locale/en.json | 0 forms/agencies/provinces/locale/es.json | 0 forms/agencies/provinces/locale/fr.json | 0 forms/agencies/provinces/locale/mn.json | 0 forms/agencies/provinces/ui.xml | 0 forms/cms/about/locale/ca.json | 0 forms/cms/about/locale/en.json | 0 forms/cms/about/locale/es.json | 0 forms/cms/about/locale/fr.json | 0 forms/cms/about/locale/mn.json | 0 forms/cms/about/ui.xml | 0 forms/cms/contact/locale/ca.json | 0 forms/cms/contact/locale/en.json | 0 forms/cms/contact/locale/es.json | 0 forms/cms/contact/locale/fr.json | 0 forms/cms/contact/locale/mn.json | 0 forms/cms/contact/ui.xml | 0 forms/cms/home/locale/ca.json | 0 forms/cms/home/locale/en.json | 0 forms/cms/home/locale/es.json | 0 forms/cms/home/locale/fr.json | 0 forms/cms/home/locale/mn.json | 0 forms/cms/home/ui.xml | 0 forms/cms/location/locale/ca.json | 0 forms/cms/location/locale/en.json | 0 forms/cms/location/locale/es.json | 0 forms/cms/location/locale/fr.json | 0 forms/cms/location/locale/mn.json | 0 forms/cms/location/ui.xml | 0 forms/cms/training/locale/ca.json | 0 forms/cms/training/locale/en.json | 0 forms/cms/training/locale/es.json | 0 forms/cms/training/locale/fr.json | 0 forms/cms/training/locale/mn.json | 0 forms/cms/training/ui.xml | 0 forms/cms/why/locale/ca.json | 0 forms/cms/why/locale/en.json | 0 forms/cms/why/locale/es.json | 0 forms/cms/why/locale/fr.json | 0 forms/cms/why/locale/mn.json | 0 forms/cms/why/ui.xml | 0 forms/ecomerce/basket/locale/ca.json | 0 forms/ecomerce/basket/locale/en.json | 0 forms/ecomerce/basket/locale/es.json | 0 forms/ecomerce/basket/locale/fr.json | 0 forms/ecomerce/basket/locale/mn.json | 0 forms/ecomerce/basket/ui.xml | 0 forms/ecomerce/catalog/locale/ca.json | 0 forms/ecomerce/catalog/locale/en.json | 0 forms/ecomerce/catalog/locale/es.json | 0 forms/ecomerce/catalog/locale/fr.json | 0 forms/ecomerce/catalog/locale/mn.json | 0 forms/ecomerce/catalog/ui.xml | 0 forms/ecomerce/checkout/locale/ca.json | 0 forms/ecomerce/checkout/locale/en.json | 0 forms/ecomerce/checkout/locale/es.json | 0 forms/ecomerce/checkout/locale/fr.json | 0 forms/ecomerce/checkout/locale/mn.json | 0 forms/ecomerce/checkout/ui.xml | 0 forms/ecomerce/confirm/locale/ca.json | 0 forms/ecomerce/confirm/locale/en.json | 0 forms/ecomerce/confirm/locale/es.json | 0 forms/ecomerce/confirm/locale/fr.json | 0 forms/ecomerce/confirm/locale/mn.json | 0 forms/ecomerce/confirm/ui.xml | 0 forms/ecomerce/invoices/locale/ca.json | 0 forms/ecomerce/invoices/locale/en.json | 0 forms/ecomerce/invoices/locale/es.json | 0 forms/ecomerce/invoices/locale/fr.json | 0 forms/ecomerce/invoices/locale/mn.json | 0 forms/ecomerce/invoices/ui.xml | 0 forms/ecomerce/orders/locale/ca.json | 0 forms/ecomerce/orders/locale/en.json | 0 forms/ecomerce/orders/locale/es.json | 0 forms/ecomerce/orders/locale/fr.json | 0 forms/ecomerce/orders/locale/mn.json | 0 forms/ecomerce/orders/ui.xml | 0 forms/ecomerce/ticket/locale/ca.json | 0 forms/ecomerce/ticket/locale/en.json | 0 forms/ecomerce/ticket/locale/es.json | 0 forms/ecomerce/ticket/locale/fr.json | 0 forms/ecomerce/ticket/locale/mn.json | 0 forms/ecomerce/ticket/ui.xml | 0 forms/news/new/locale/ca.json | 0 forms/news/new/locale/en.json | 0 forms/news/new/locale/es.json | 0 forms/news/new/locale/fr.json | 0 forms/news/new/locale/mn.json | 0 forms/news/new/ui.xml | 0 forms/news/news/locale/ca.json | 0 forms/news/news/locale/en.json | 0 forms/news/news/locale/es.json | 0 forms/news/news/locale/fr.json | 0 forms/news/news/locale/mn.json | 0 forms/news/news/ui.xml | 0 forms/reports/items-form/ui.xml | 0 forms/reports/shelves/ui.xml | 0 index.php | 0 pages/main/ui.php | 0 pages/update-browser/locale/ca.json | 0 pages/update-browser/locale/en.json | 0 pages/update-browser/locale/es.json | 0 pages/update-browser/locale/fr.json | 0 pages/update-browser/locale/mn.json | 0 pages/update-browser/style.css | 0 pages/update-browser/ui.php | 0 pages/version-menu/locale/ca.json | 0 pages/version-menu/locale/en.json | 0 pages/version-menu/locale/es.json | 0 pages/version-menu/locale/fr.json | 0 pages/version-menu/locale/mn.json | 0 pages/version-menu/style.css | 0 pages/version-menu/ui.php | 0 rest/core/IndieFlower.ttf | Bin rest/core/account.php | 0 rest/core/captcha.php | 0 rest/core/change-password.php | 0 rest/core/locale/ca.json | 0 rest/core/locale/es.json | 0 rest/core/locale/fr.json | 0 rest/core/locale/mn.json | 0 rest/core/log.php | 0 rest/core/login.php | 0 rest/core/logout.php | 0 rest/core/query.php | 0 rest/core/recover-password.php | 0 rest/core/set-password.php | 0 rest/core/supplant.php | 0 rest/core/sync-user.php | 0 rest/image/image.php | 0 rest/image/locale/en.json | 0 rest/image/locale/es.json | 0 rest/image/upload.php | 0 rest/image/util.php | 0 rest/misc/access-version.php | 0 rest/misc/contact.php | 0 rest/misc/exchange-rate.php | 0 rest/misc/mail.php | 0 rest/tpv/tpv.php | 0 rest/tpv/transaction.php | 0 web/db-session-handler.php | 0 web/json-exception.php | 0 web/json-reply.php | 0 web/jwt.php | 0 web/locale/en.json | 0 web/locale/es.json | 0 web/mailer.php | 0 web/report.php | 0 web/service.php | 0 web/unavailable.html | 0 225 files changed, 3 insertions(+), 12 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 conf/config.php mode change 100644 => 100755 debian/cron.d mode change 100755 => 100644 forms/account/address-list/locale/ca.json mode change 100755 => 100644 forms/account/address-list/locale/en.json mode change 100755 => 100644 forms/account/address-list/locale/es.json mode change 100755 => 100644 forms/account/address-list/locale/fr.json mode change 100755 => 100644 forms/account/address-list/locale/mn.json mode change 100755 => 100644 forms/account/address-list/ui.xml mode change 100755 => 100644 forms/account/address/locale/ca.json mode change 100755 => 100644 forms/account/address/locale/en.json mode change 100755 => 100644 forms/account/address/locale/es.json mode change 100755 => 100644 forms/account/address/locale/fr.json mode change 100755 => 100644 forms/account/address/locale/mn.json mode change 100755 => 100644 forms/account/address/ui.xml mode change 100755 => 100644 forms/account/conf/locale/ca.json mode change 100755 => 100644 forms/account/conf/locale/en.json mode change 100755 => 100644 forms/account/conf/locale/es.json mode change 100755 => 100644 forms/account/conf/locale/fr.json mode change 100755 => 100644 forms/account/conf/locale/mn.json mode change 100755 => 100644 forms/account/conf/ui.xml mode change 100755 => 100644 forms/admin/access-log/ui.xml mode change 100755 => 100644 forms/admin/connections/locale/ca.json mode change 100755 => 100644 forms/admin/connections/locale/en.json mode change 100755 => 100644 forms/admin/connections/locale/es.json mode change 100755 => 100644 forms/admin/connections/locale/fr.json mode change 100755 => 100644 forms/admin/connections/locale/mn.json mode change 100755 => 100644 forms/admin/connections/locale/pt.json mode change 100755 => 100644 forms/admin/connections/ui.xml mode change 100755 => 100644 forms/admin/items/locale/ca.json mode change 100755 => 100644 forms/admin/items/locale/en.json mode change 100755 => 100644 forms/admin/items/locale/es.json mode change 100755 => 100644 forms/admin/items/locale/fr.json mode change 100755 => 100644 forms/admin/items/locale/mn.json mode change 100755 => 100644 forms/admin/items/ui.xml mode change 100755 => 100644 forms/admin/links/locale/ca.json mode change 100755 => 100644 forms/admin/links/locale/en.json mode change 100755 => 100644 forms/admin/links/locale/es.json mode change 100755 => 100644 forms/admin/links/locale/fr.json mode change 100755 => 100644 forms/admin/links/locale/mn.json mode change 100755 => 100644 forms/admin/links/ui.xml mode change 100755 => 100644 forms/admin/photos/locale/ca.json mode change 100755 => 100644 forms/admin/photos/locale/en.json mode change 100755 => 100644 forms/admin/photos/locale/es.json mode change 100755 => 100644 forms/admin/photos/locale/fr.json mode change 100755 => 100644 forms/admin/photos/locale/mn.json mode change 100755 => 100644 forms/admin/photos/ui.xml mode change 100755 => 100644 forms/admin/queries/locale/ca.json mode change 100755 => 100644 forms/admin/queries/locale/en.json mode change 100755 => 100644 forms/admin/queries/locale/es.json mode change 100755 => 100644 forms/admin/queries/locale/fr.json mode change 100755 => 100644 forms/admin/queries/locale/mn.json mode change 100755 => 100644 forms/admin/queries/locale/pt.json mode change 100755 => 100644 forms/admin/queries/ui.xml mode change 100755 => 100644 forms/admin/users/locale/ca.json mode change 100755 => 100644 forms/admin/users/locale/en.json mode change 100755 => 100644 forms/admin/users/locale/es.json mode change 100755 => 100644 forms/admin/users/locale/fr.json mode change 100755 => 100644 forms/admin/users/locale/mn.json mode change 100755 => 100644 forms/admin/users/ui.xml mode change 100755 => 100644 forms/admin/visits/locale/ca.json mode change 100755 => 100644 forms/admin/visits/locale/en.json mode change 100755 => 100644 forms/admin/visits/locale/es.json mode change 100755 => 100644 forms/admin/visits/locale/fr.json mode change 100755 => 100644 forms/admin/visits/locale/mn.json mode change 100755 => 100644 forms/admin/visits/locale/pt.json mode change 100755 => 100644 forms/admin/visits/ui.xml mode change 100755 => 100644 forms/agencies/packages/locale/ca.json mode change 100755 => 100644 forms/agencies/packages/locale/en.json mode change 100755 => 100644 forms/agencies/packages/locale/es.json mode change 100755 => 100644 forms/agencies/packages/locale/fr.json mode change 100755 => 100644 forms/agencies/packages/locale/mn.json mode change 100755 => 100644 forms/agencies/packages/ui.xml mode change 100755 => 100644 forms/agencies/provinces/locale/ca.json mode change 100755 => 100644 forms/agencies/provinces/locale/en.json mode change 100755 => 100644 forms/agencies/provinces/locale/es.json mode change 100755 => 100644 forms/agencies/provinces/locale/fr.json mode change 100755 => 100644 forms/agencies/provinces/locale/mn.json mode change 100755 => 100644 forms/agencies/provinces/ui.xml mode change 100755 => 100644 forms/cms/about/locale/ca.json mode change 100755 => 100644 forms/cms/about/locale/en.json mode change 100755 => 100644 forms/cms/about/locale/es.json mode change 100755 => 100644 forms/cms/about/locale/fr.json mode change 100755 => 100644 forms/cms/about/locale/mn.json mode change 100755 => 100644 forms/cms/about/ui.xml mode change 100755 => 100644 forms/cms/contact/locale/ca.json mode change 100755 => 100644 forms/cms/contact/locale/en.json mode change 100755 => 100644 forms/cms/contact/locale/es.json mode change 100755 => 100644 forms/cms/contact/locale/fr.json mode change 100755 => 100644 forms/cms/contact/locale/mn.json mode change 100755 => 100644 forms/cms/contact/ui.xml mode change 100755 => 100644 forms/cms/home/locale/ca.json mode change 100755 => 100644 forms/cms/home/locale/en.json mode change 100755 => 100644 forms/cms/home/locale/es.json mode change 100755 => 100644 forms/cms/home/locale/fr.json mode change 100755 => 100644 forms/cms/home/locale/mn.json mode change 100755 => 100644 forms/cms/home/ui.xml mode change 100755 => 100644 forms/cms/location/locale/ca.json mode change 100755 => 100644 forms/cms/location/locale/en.json mode change 100755 => 100644 forms/cms/location/locale/es.json mode change 100755 => 100644 forms/cms/location/locale/fr.json mode change 100755 => 100644 forms/cms/location/locale/mn.json mode change 100755 => 100644 forms/cms/location/ui.xml mode change 100755 => 100644 forms/cms/training/locale/ca.json mode change 100755 => 100644 forms/cms/training/locale/en.json mode change 100755 => 100644 forms/cms/training/locale/es.json mode change 100755 => 100644 forms/cms/training/locale/fr.json mode change 100755 => 100644 forms/cms/training/locale/mn.json mode change 100755 => 100644 forms/cms/training/ui.xml mode change 100755 => 100644 forms/cms/why/locale/ca.json mode change 100755 => 100644 forms/cms/why/locale/en.json mode change 100755 => 100644 forms/cms/why/locale/es.json mode change 100755 => 100644 forms/cms/why/locale/fr.json mode change 100755 => 100644 forms/cms/why/locale/mn.json mode change 100755 => 100644 forms/cms/why/ui.xml mode change 100755 => 100644 forms/ecomerce/basket/locale/ca.json mode change 100755 => 100644 forms/ecomerce/basket/locale/en.json mode change 100755 => 100644 forms/ecomerce/basket/locale/es.json mode change 100755 => 100644 forms/ecomerce/basket/locale/fr.json mode change 100755 => 100644 forms/ecomerce/basket/locale/mn.json mode change 100755 => 100644 forms/ecomerce/basket/ui.xml mode change 100755 => 100644 forms/ecomerce/catalog/locale/ca.json mode change 100755 => 100644 forms/ecomerce/catalog/locale/en.json mode change 100755 => 100644 forms/ecomerce/catalog/locale/es.json mode change 100755 => 100644 forms/ecomerce/catalog/locale/fr.json mode change 100755 => 100644 forms/ecomerce/catalog/locale/mn.json mode change 100755 => 100644 forms/ecomerce/catalog/ui.xml mode change 100755 => 100644 forms/ecomerce/checkout/locale/ca.json mode change 100755 => 100644 forms/ecomerce/checkout/locale/en.json mode change 100755 => 100644 forms/ecomerce/checkout/locale/es.json mode change 100755 => 100644 forms/ecomerce/checkout/locale/fr.json mode change 100755 => 100644 forms/ecomerce/checkout/locale/mn.json mode change 100755 => 100644 forms/ecomerce/checkout/ui.xml mode change 100755 => 100644 forms/ecomerce/confirm/locale/ca.json mode change 100755 => 100644 forms/ecomerce/confirm/locale/en.json mode change 100755 => 100644 forms/ecomerce/confirm/locale/es.json mode change 100755 => 100644 forms/ecomerce/confirm/locale/fr.json mode change 100755 => 100644 forms/ecomerce/confirm/locale/mn.json mode change 100755 => 100644 forms/ecomerce/confirm/ui.xml mode change 100755 => 100644 forms/ecomerce/invoices/locale/ca.json mode change 100755 => 100644 forms/ecomerce/invoices/locale/en.json mode change 100755 => 100644 forms/ecomerce/invoices/locale/es.json mode change 100755 => 100644 forms/ecomerce/invoices/locale/fr.json mode change 100755 => 100644 forms/ecomerce/invoices/locale/mn.json mode change 100755 => 100644 forms/ecomerce/invoices/ui.xml mode change 100755 => 100644 forms/ecomerce/orders/locale/ca.json mode change 100755 => 100644 forms/ecomerce/orders/locale/en.json mode change 100755 => 100644 forms/ecomerce/orders/locale/es.json mode change 100755 => 100644 forms/ecomerce/orders/locale/fr.json mode change 100755 => 100644 forms/ecomerce/orders/locale/mn.json mode change 100755 => 100644 forms/ecomerce/orders/ui.xml mode change 100755 => 100644 forms/ecomerce/ticket/locale/ca.json mode change 100755 => 100644 forms/ecomerce/ticket/locale/en.json mode change 100755 => 100644 forms/ecomerce/ticket/locale/es.json mode change 100755 => 100644 forms/ecomerce/ticket/locale/fr.json mode change 100755 => 100644 forms/ecomerce/ticket/locale/mn.json mode change 100755 => 100644 forms/ecomerce/ticket/ui.xml mode change 100755 => 100644 forms/news/new/locale/ca.json mode change 100755 => 100644 forms/news/new/locale/en.json mode change 100755 => 100644 forms/news/new/locale/es.json mode change 100755 => 100644 forms/news/new/locale/fr.json mode change 100755 => 100644 forms/news/new/locale/mn.json mode change 100755 => 100644 forms/news/new/ui.xml mode change 100755 => 100644 forms/news/news/locale/ca.json mode change 100755 => 100644 forms/news/news/locale/en.json mode change 100755 => 100644 forms/news/news/locale/es.json mode change 100755 => 100644 forms/news/news/locale/fr.json mode change 100755 => 100644 forms/news/news/locale/mn.json mode change 100755 => 100644 forms/news/news/ui.xml mode change 100755 => 100644 forms/reports/items-form/ui.xml mode change 100755 => 100644 forms/reports/shelves/ui.xml mode change 100755 => 100644 index.php mode change 100755 => 100644 pages/main/ui.php mode change 100755 => 100644 pages/update-browser/locale/ca.json mode change 100755 => 100644 pages/update-browser/locale/en.json mode change 100755 => 100644 pages/update-browser/locale/es.json mode change 100755 => 100644 pages/update-browser/locale/fr.json mode change 100755 => 100644 pages/update-browser/locale/mn.json mode change 100755 => 100644 pages/update-browser/style.css mode change 100755 => 100644 pages/update-browser/ui.php mode change 100755 => 100644 pages/version-menu/locale/ca.json mode change 100755 => 100644 pages/version-menu/locale/en.json mode change 100755 => 100644 pages/version-menu/locale/es.json mode change 100755 => 100644 pages/version-menu/locale/fr.json mode change 100755 => 100644 pages/version-menu/locale/mn.json mode change 100755 => 100644 pages/version-menu/style.css mode change 100755 => 100644 pages/version-menu/ui.php mode change 100755 => 100644 rest/core/IndieFlower.ttf mode change 100755 => 100644 rest/core/account.php mode change 100755 => 100644 rest/core/captcha.php mode change 100755 => 100644 rest/core/change-password.php mode change 100755 => 100644 rest/core/locale/ca.json mode change 100755 => 100644 rest/core/locale/es.json mode change 100755 => 100644 rest/core/locale/fr.json mode change 100755 => 100644 rest/core/locale/mn.json mode change 100755 => 100644 rest/core/log.php mode change 100755 => 100644 rest/core/login.php mode change 100755 => 100644 rest/core/logout.php mode change 100755 => 100644 rest/core/query.php mode change 100755 => 100644 rest/core/recover-password.php mode change 100755 => 100644 rest/core/set-password.php mode change 100755 => 100644 rest/core/supplant.php mode change 100755 => 100644 rest/core/sync-user.php mode change 100755 => 100644 rest/image/image.php mode change 100755 => 100644 rest/image/locale/en.json mode change 100755 => 100644 rest/image/locale/es.json mode change 100755 => 100644 rest/image/upload.php mode change 100755 => 100644 rest/image/util.php mode change 100755 => 100644 rest/misc/access-version.php mode change 100755 => 100644 rest/misc/contact.php mode change 100755 => 100644 rest/misc/exchange-rate.php mode change 100755 => 100644 rest/misc/mail.php mode change 100755 => 100644 rest/tpv/tpv.php mode change 100755 => 100644 rest/tpv/transaction.php mode change 100755 => 100644 web/db-session-handler.php mode change 100755 => 100644 web/json-exception.php mode change 100755 => 100644 web/json-reply.php mode change 100755 => 100644 web/jwt.php mode change 100755 => 100644 web/locale/en.json mode change 100755 => 100644 web/locale/es.json mode change 100755 => 100644 web/mailer.php mode change 100755 => 100644 web/report.php mode change 100755 => 100644 web/service.php mode change 100755 => 100644 web/unavailable.html diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/conf/apache.conf b/conf/apache.conf index e550f557..c502e40a 100644 --- a/conf/apache.conf +++ b/conf/apache.conf @@ -2,33 +2,24 @@ # Alias /image-db /var/lib/hedera-web/image-db/ - Options -Indexes -FollowSymLinks AllowOverride None - - Order Allow,Deny - Allow From All - + Require all granted + SetOutputFilter DEFLATE - + Header set Access-Control-Allow-Origin "*" - - Options Indexes FollowSymLinks MultiViews AllowOverride FileInfo Options - - Order Allow,Deny - Allow From All Require all granted - diff --git a/conf/config.php b/conf/config.php old mode 100755 new mode 100644 diff --git a/debian/cron.d b/debian/cron.d old mode 100644 new mode 100755 diff --git a/forms/account/address-list/locale/ca.json b/forms/account/address-list/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/account/address-list/locale/en.json b/forms/account/address-list/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/account/address-list/locale/es.json b/forms/account/address-list/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/account/address-list/locale/fr.json b/forms/account/address-list/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/account/address-list/locale/mn.json b/forms/account/address-list/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/account/address-list/ui.xml b/forms/account/address-list/ui.xml old mode 100755 new mode 100644 diff --git a/forms/account/address/locale/ca.json b/forms/account/address/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/account/address/locale/en.json b/forms/account/address/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/account/address/locale/es.json b/forms/account/address/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/account/address/locale/fr.json b/forms/account/address/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/account/address/locale/mn.json b/forms/account/address/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/account/address/ui.xml b/forms/account/address/ui.xml old mode 100755 new mode 100644 diff --git a/forms/account/conf/locale/ca.json b/forms/account/conf/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/account/conf/locale/en.json b/forms/account/conf/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/account/conf/locale/es.json b/forms/account/conf/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/account/conf/locale/fr.json b/forms/account/conf/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/account/conf/locale/mn.json b/forms/account/conf/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/access-log/ui.xml b/forms/admin/access-log/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/ca.json b/forms/admin/connections/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/en.json b/forms/admin/connections/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/es.json b/forms/admin/connections/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/fr.json b/forms/admin/connections/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/mn.json b/forms/admin/connections/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/locale/pt.json b/forms/admin/connections/locale/pt.json old mode 100755 new mode 100644 diff --git a/forms/admin/connections/ui.xml b/forms/admin/connections/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/items/locale/ca.json b/forms/admin/items/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/items/locale/en.json b/forms/admin/items/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/items/locale/es.json b/forms/admin/items/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/items/locale/fr.json b/forms/admin/items/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/items/locale/mn.json b/forms/admin/items/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/items/ui.xml b/forms/admin/items/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/links/locale/ca.json b/forms/admin/links/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/links/locale/en.json b/forms/admin/links/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/links/locale/es.json b/forms/admin/links/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/links/locale/fr.json b/forms/admin/links/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/links/locale/mn.json b/forms/admin/links/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/links/ui.xml b/forms/admin/links/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/photos/locale/ca.json b/forms/admin/photos/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/photos/locale/en.json b/forms/admin/photos/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/photos/locale/es.json b/forms/admin/photos/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/photos/locale/fr.json b/forms/admin/photos/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/photos/locale/mn.json b/forms/admin/photos/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/photos/ui.xml b/forms/admin/photos/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/ca.json b/forms/admin/queries/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/en.json b/forms/admin/queries/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/es.json b/forms/admin/queries/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/fr.json b/forms/admin/queries/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/mn.json b/forms/admin/queries/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/locale/pt.json b/forms/admin/queries/locale/pt.json old mode 100755 new mode 100644 diff --git a/forms/admin/queries/ui.xml b/forms/admin/queries/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/users/locale/ca.json b/forms/admin/users/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/users/locale/en.json b/forms/admin/users/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/users/locale/es.json b/forms/admin/users/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/users/locale/fr.json b/forms/admin/users/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/users/locale/mn.json b/forms/admin/users/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/users/ui.xml b/forms/admin/users/ui.xml old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/ca.json b/forms/admin/visits/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/en.json b/forms/admin/visits/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/es.json b/forms/admin/visits/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/fr.json b/forms/admin/visits/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/mn.json b/forms/admin/visits/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/locale/pt.json b/forms/admin/visits/locale/pt.json old mode 100755 new mode 100644 diff --git a/forms/admin/visits/ui.xml b/forms/admin/visits/ui.xml old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/locale/ca.json b/forms/agencies/packages/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/locale/en.json b/forms/agencies/packages/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/locale/es.json b/forms/agencies/packages/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/locale/fr.json b/forms/agencies/packages/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/locale/mn.json b/forms/agencies/packages/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/agencies/packages/ui.xml b/forms/agencies/packages/ui.xml old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/locale/ca.json b/forms/agencies/provinces/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/locale/en.json b/forms/agencies/provinces/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/locale/es.json b/forms/agencies/provinces/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/locale/fr.json b/forms/agencies/provinces/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/locale/mn.json b/forms/agencies/provinces/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/agencies/provinces/ui.xml b/forms/agencies/provinces/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/about/locale/ca.json b/forms/cms/about/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/about/locale/en.json b/forms/cms/about/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/about/locale/es.json b/forms/cms/about/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/about/locale/fr.json b/forms/cms/about/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/about/locale/mn.json b/forms/cms/about/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/about/ui.xml b/forms/cms/about/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/contact/locale/ca.json b/forms/cms/contact/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/contact/locale/en.json b/forms/cms/contact/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/contact/locale/es.json b/forms/cms/contact/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/contact/locale/fr.json b/forms/cms/contact/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/contact/locale/mn.json b/forms/cms/contact/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/contact/ui.xml b/forms/cms/contact/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/home/locale/ca.json b/forms/cms/home/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/home/locale/en.json b/forms/cms/home/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/home/locale/es.json b/forms/cms/home/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/home/locale/fr.json b/forms/cms/home/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/home/locale/mn.json b/forms/cms/home/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/home/ui.xml b/forms/cms/home/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/location/locale/ca.json b/forms/cms/location/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/location/locale/en.json b/forms/cms/location/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/location/locale/es.json b/forms/cms/location/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/location/locale/fr.json b/forms/cms/location/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/location/locale/mn.json b/forms/cms/location/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/location/ui.xml b/forms/cms/location/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/training/locale/ca.json b/forms/cms/training/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/training/locale/en.json b/forms/cms/training/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/training/locale/es.json b/forms/cms/training/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/training/locale/fr.json b/forms/cms/training/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/training/locale/mn.json b/forms/cms/training/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/training/ui.xml b/forms/cms/training/ui.xml old mode 100755 new mode 100644 diff --git a/forms/cms/why/locale/ca.json b/forms/cms/why/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/cms/why/locale/en.json b/forms/cms/why/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/cms/why/locale/es.json b/forms/cms/why/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/cms/why/locale/fr.json b/forms/cms/why/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/cms/why/locale/mn.json b/forms/cms/why/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/cms/why/ui.xml b/forms/cms/why/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/locale/ca.json b/forms/ecomerce/basket/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/locale/en.json b/forms/ecomerce/basket/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/locale/es.json b/forms/ecomerce/basket/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/locale/fr.json b/forms/ecomerce/basket/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/locale/mn.json b/forms/ecomerce/basket/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/basket/ui.xml b/forms/ecomerce/basket/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/locale/ca.json b/forms/ecomerce/catalog/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/locale/en.json b/forms/ecomerce/catalog/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/locale/es.json b/forms/ecomerce/catalog/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/locale/fr.json b/forms/ecomerce/catalog/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/locale/mn.json b/forms/ecomerce/catalog/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/locale/ca.json b/forms/ecomerce/checkout/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/locale/en.json b/forms/ecomerce/checkout/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/locale/es.json b/forms/ecomerce/checkout/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/locale/fr.json b/forms/ecomerce/checkout/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/locale/mn.json b/forms/ecomerce/checkout/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/locale/ca.json b/forms/ecomerce/confirm/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/locale/en.json b/forms/ecomerce/confirm/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/locale/es.json b/forms/ecomerce/confirm/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/locale/fr.json b/forms/ecomerce/confirm/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/locale/mn.json b/forms/ecomerce/confirm/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/locale/ca.json b/forms/ecomerce/invoices/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/locale/en.json b/forms/ecomerce/invoices/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/locale/es.json b/forms/ecomerce/invoices/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/locale/fr.json b/forms/ecomerce/invoices/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/locale/mn.json b/forms/ecomerce/invoices/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/invoices/ui.xml b/forms/ecomerce/invoices/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/locale/ca.json b/forms/ecomerce/orders/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/locale/en.json b/forms/ecomerce/orders/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/locale/es.json b/forms/ecomerce/orders/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/locale/fr.json b/forms/ecomerce/orders/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/locale/mn.json b/forms/ecomerce/orders/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/locale/ca.json b/forms/ecomerce/ticket/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/locale/en.json b/forms/ecomerce/ticket/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/locale/es.json b/forms/ecomerce/ticket/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/locale/fr.json b/forms/ecomerce/ticket/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/locale/mn.json b/forms/ecomerce/ticket/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml old mode 100755 new mode 100644 diff --git a/forms/news/new/locale/ca.json b/forms/news/new/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/news/new/locale/en.json b/forms/news/new/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/news/new/locale/es.json b/forms/news/new/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/news/new/locale/fr.json b/forms/news/new/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/news/new/locale/mn.json b/forms/news/new/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/news/new/ui.xml b/forms/news/new/ui.xml old mode 100755 new mode 100644 diff --git a/forms/news/news/locale/ca.json b/forms/news/news/locale/ca.json old mode 100755 new mode 100644 diff --git a/forms/news/news/locale/en.json b/forms/news/news/locale/en.json old mode 100755 new mode 100644 diff --git a/forms/news/news/locale/es.json b/forms/news/news/locale/es.json old mode 100755 new mode 100644 diff --git a/forms/news/news/locale/fr.json b/forms/news/news/locale/fr.json old mode 100755 new mode 100644 diff --git a/forms/news/news/locale/mn.json b/forms/news/news/locale/mn.json old mode 100755 new mode 100644 diff --git a/forms/news/news/ui.xml b/forms/news/news/ui.xml old mode 100755 new mode 100644 diff --git a/forms/reports/items-form/ui.xml b/forms/reports/items-form/ui.xml old mode 100755 new mode 100644 diff --git a/forms/reports/shelves/ui.xml b/forms/reports/shelves/ui.xml old mode 100755 new mode 100644 diff --git a/index.php b/index.php old mode 100755 new mode 100644 diff --git a/pages/main/ui.php b/pages/main/ui.php old mode 100755 new mode 100644 diff --git a/pages/update-browser/locale/ca.json b/pages/update-browser/locale/ca.json old mode 100755 new mode 100644 diff --git a/pages/update-browser/locale/en.json b/pages/update-browser/locale/en.json old mode 100755 new mode 100644 diff --git a/pages/update-browser/locale/es.json b/pages/update-browser/locale/es.json old mode 100755 new mode 100644 diff --git a/pages/update-browser/locale/fr.json b/pages/update-browser/locale/fr.json old mode 100755 new mode 100644 diff --git a/pages/update-browser/locale/mn.json b/pages/update-browser/locale/mn.json old mode 100755 new mode 100644 diff --git a/pages/update-browser/style.css b/pages/update-browser/style.css old mode 100755 new mode 100644 diff --git a/pages/update-browser/ui.php b/pages/update-browser/ui.php old mode 100755 new mode 100644 diff --git a/pages/version-menu/locale/ca.json b/pages/version-menu/locale/ca.json old mode 100755 new mode 100644 diff --git a/pages/version-menu/locale/en.json b/pages/version-menu/locale/en.json old mode 100755 new mode 100644 diff --git a/pages/version-menu/locale/es.json b/pages/version-menu/locale/es.json old mode 100755 new mode 100644 diff --git a/pages/version-menu/locale/fr.json b/pages/version-menu/locale/fr.json old mode 100755 new mode 100644 diff --git a/pages/version-menu/locale/mn.json b/pages/version-menu/locale/mn.json old mode 100755 new mode 100644 diff --git a/pages/version-menu/style.css b/pages/version-menu/style.css old mode 100755 new mode 100644 diff --git a/pages/version-menu/ui.php b/pages/version-menu/ui.php old mode 100755 new mode 100644 diff --git a/rest/core/IndieFlower.ttf b/rest/core/IndieFlower.ttf old mode 100755 new mode 100644 diff --git a/rest/core/account.php b/rest/core/account.php old mode 100755 new mode 100644 diff --git a/rest/core/captcha.php b/rest/core/captcha.php old mode 100755 new mode 100644 diff --git a/rest/core/change-password.php b/rest/core/change-password.php old mode 100755 new mode 100644 diff --git a/rest/core/locale/ca.json b/rest/core/locale/ca.json old mode 100755 new mode 100644 diff --git a/rest/core/locale/es.json b/rest/core/locale/es.json old mode 100755 new mode 100644 diff --git a/rest/core/locale/fr.json b/rest/core/locale/fr.json old mode 100755 new mode 100644 diff --git a/rest/core/locale/mn.json b/rest/core/locale/mn.json old mode 100755 new mode 100644 diff --git a/rest/core/log.php b/rest/core/log.php old mode 100755 new mode 100644 diff --git a/rest/core/login.php b/rest/core/login.php old mode 100755 new mode 100644 diff --git a/rest/core/logout.php b/rest/core/logout.php old mode 100755 new mode 100644 diff --git a/rest/core/query.php b/rest/core/query.php old mode 100755 new mode 100644 diff --git a/rest/core/recover-password.php b/rest/core/recover-password.php old mode 100755 new mode 100644 diff --git a/rest/core/set-password.php b/rest/core/set-password.php old mode 100755 new mode 100644 diff --git a/rest/core/supplant.php b/rest/core/supplant.php old mode 100755 new mode 100644 diff --git a/rest/core/sync-user.php b/rest/core/sync-user.php old mode 100755 new mode 100644 diff --git a/rest/image/image.php b/rest/image/image.php old mode 100755 new mode 100644 diff --git a/rest/image/locale/en.json b/rest/image/locale/en.json old mode 100755 new mode 100644 diff --git a/rest/image/locale/es.json b/rest/image/locale/es.json old mode 100755 new mode 100644 diff --git a/rest/image/upload.php b/rest/image/upload.php old mode 100755 new mode 100644 diff --git a/rest/image/util.php b/rest/image/util.php old mode 100755 new mode 100644 diff --git a/rest/misc/access-version.php b/rest/misc/access-version.php old mode 100755 new mode 100644 diff --git a/rest/misc/contact.php b/rest/misc/contact.php old mode 100755 new mode 100644 diff --git a/rest/misc/exchange-rate.php b/rest/misc/exchange-rate.php old mode 100755 new mode 100644 diff --git a/rest/misc/mail.php b/rest/misc/mail.php old mode 100755 new mode 100644 diff --git a/rest/tpv/tpv.php b/rest/tpv/tpv.php old mode 100755 new mode 100644 diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php old mode 100755 new mode 100644 diff --git a/web/db-session-handler.php b/web/db-session-handler.php old mode 100755 new mode 100644 diff --git a/web/json-exception.php b/web/json-exception.php old mode 100755 new mode 100644 diff --git a/web/json-reply.php b/web/json-reply.php old mode 100755 new mode 100644 diff --git a/web/jwt.php b/web/jwt.php old mode 100755 new mode 100644 diff --git a/web/locale/en.json b/web/locale/en.json old mode 100755 new mode 100644 diff --git a/web/locale/es.json b/web/locale/es.json old mode 100755 new mode 100644 diff --git a/web/mailer.php b/web/mailer.php old mode 100755 new mode 100644 diff --git a/web/report.php b/web/report.php old mode 100755 new mode 100644 diff --git a/web/service.php b/web/service.php old mode 100755 new mode 100644 diff --git a/web/unavailable.html b/web/unavailable.html old mode 100755 new mode 100644 From 9a009cacc0e573d3e111ceac1a05be0cd01eab92 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 13:28:42 +0100 Subject: [PATCH 11/35] Lintian warnings solved --- debian/control | 9 +++++---- debian/install | 1 - debian/postinst | 12 ++++++++++-- debian/postrm | 8 ++++++++ debian/rules | 2 +- js/hedera/gui.xml | 0 js/hedera/login.xml | 0 js/hedera/report.html | 0 reports/delivery-note/ui.xml | 0 reports/items-report/ui.xml | 0 reports/recover-password/ui.php | 0 reports/shelves-report/ui.xml | 0 12 files changed, 24 insertions(+), 8 deletions(-) mode change 100755 => 100644 js/hedera/gui.xml mode change 100755 => 100644 js/hedera/login.xml mode change 100755 => 100644 js/hedera/report.html mode change 100755 => 100644 reports/delivery-note/ui.xml mode change 100755 => 100644 reports/items-report/ui.xml mode change 100755 => 100644 reports/recover-password/ui.php mode change 100755 => 100644 reports/shelves-report/ui.xml diff --git a/debian/control b/debian/control index a3a71323..e5367b3b 100644 --- a/debian/control +++ b/debian/control @@ -1,17 +1,18 @@ Source: hedera-web Priority: optional Maintainer: Juan Ferrer Toribio -Build-Depends: build-essential, debhelper, nodejs +Build-Depends: build-essential, debhelper, dh-apache2, nodejs Standards-Version: 3.9.3 Section: misc Homepage: http://www.verdnatura.es -Vcs-Git: git://www.verdnatura.es/var/git/hedera-web +Vcs-Git: https://git.verdnatura.es/hedera-web Package: hedera-web Architecture: all -Depends: apache2, php5-mysql, php5-mcrypt, php5-ldap, php5-ssh2, php-vn-lib, nodejs +Depends: apache2 | httpd, nodejs, php5-cli, php5-mysql, php5-mcrypt, php5-ldap, php5-ssh2, php-vn-lib Suggests: php-text-captcha, php5-imap, tinymce Section: misc Priority: optional Description: Verdnatura's web page - Verdnatura's web page. + Web page used by Verdnatura, it includes user authetication, a simple CMS and + a webpshop. diff --git a/debian/install b/debian/install index 7e79b186..68a9ca27 100644 --- a/debian/install +++ b/debian/install @@ -11,6 +11,5 @@ rest usr/share/hedera-web index.php usr/share/hedera-web package.json usr/share/hedera-web build usr/share/hedera-web -LICENSE usr/share/hedera-web README.md usr/share/hedera-web webpack.config.json usr/share/hedera-web diff --git a/debian/postinst b/debian/postinst index 13608102..314c646b 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,7 +1,15 @@ #!/bin/bash -cd /usr/share/hedera-web && npm install --production -a2enconf hedera-web +set -e + +(cd /usr/share/hedera-web && npm install --production) + +if [ -e /usr/share/apache2/apache2-maintscript-helper ] +then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf hedera-web.conf +fi + service apache2 reload service php5-fpm restart service cron restart diff --git a/debian/postrm b/debian/postrm index d2d54aca..d1172f9e 100755 --- a/debian/postrm +++ b/debian/postrm @@ -1,5 +1,13 @@ #!/bin/bash +set -e + +if [ -e /usr/share/apache2/apache2-maintscript-helper ] +then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf hedera-web.conf +fi + rm -rf /usr/share/hedera-web/node_modules service apache2 reload service cron restart diff --git a/debian/rules b/debian/rules index a8f9a7e2..53e46d63 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ #export DH_VERBOSE=1 %: - dh $@ + dh $@ --with apache2 clean: npm --production run clean diff --git a/js/hedera/gui.xml b/js/hedera/gui.xml old mode 100755 new mode 100644 diff --git a/js/hedera/login.xml b/js/hedera/login.xml old mode 100755 new mode 100644 diff --git a/js/hedera/report.html b/js/hedera/report.html old mode 100755 new mode 100644 diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml old mode 100755 new mode 100644 diff --git a/reports/items-report/ui.xml b/reports/items-report/ui.xml old mode 100755 new mode 100644 diff --git a/reports/recover-password/ui.php b/reports/recover-password/ui.php old mode 100755 new mode 100644 diff --git a/reports/shelves-report/ui.xml b/reports/shelves-report/ui.xml old mode 100755 new mode 100644 From 421b37e2020ccf96af48eae7da07cab3b6b615dd Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 13:33:25 +0100 Subject: [PATCH 12/35] Lintian warnings solved --- debian/control | 2 +- debian/postinst | 1 - debian/postrm | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/control b/debian/control index e5367b3b..f3611f39 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, dh-apache2, nodejs +Build-Depends: build-essential, debhelper, nodejs Standards-Version: 3.9.3 Section: misc Homepage: http://www.verdnatura.es diff --git a/debian/postinst b/debian/postinst index 314c646b..536e6b82 100755 --- a/debian/postinst +++ b/debian/postinst @@ -10,7 +10,6 @@ then apache2_invoke enconf hedera-web.conf fi -service apache2 reload service php5-fpm restart service cron restart diff --git a/debian/postrm b/debian/postrm index d1172f9e..cf986935 100755 --- a/debian/postrm +++ b/debian/postrm @@ -9,5 +9,4 @@ then fi rm -rf /usr/share/hedera-web/node_modules -service apache2 reload service cron restart From 9a28493e2f252d9e2f5d31f34a50a4e0ceedad82 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 13:35:58 +0100 Subject: [PATCH 13/35] Lintian bugs solved --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 53e46d63..a8f9a7e2 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ #export DH_VERBOSE=1 %: - dh $@ --with apache2 + dh $@ clean: npm --production run clean From c7b158b015f72297ec40a365c6d673b893bab248 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 13:50:29 +0100 Subject: [PATCH 14/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ae969c89..ee36fe3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.36) stable; urgency=low +hedera-web (1.405.37) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 88d5af9a..db8d83b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.36", + "version": "1.405.37", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From e00788bc1cea17e8911ce6e076c5b6654766bb92 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 16:31:58 +0100 Subject: [PATCH 15/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ee36fe3a..655e7620 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.37) stable; urgency=low +hedera-web (1.405.38) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index db8d83b9..f5642825 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.37", + "version": "1.405.38", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 5becc16d5acff964cd0a9e271925a116bfdd6d92 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 16:33:30 +0100 Subject: [PATCH 16/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 655e7620..4e15a710 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.38) stable; urgency=low +hedera-web (1.405.39) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index f5642825..2c737900 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.38", + "version": "1.405.39", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 2fbdfe5d789abefeae05560060efa21fc55818c0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 11 Dec 2017 16:43:06 +0100 Subject: [PATCH 17/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4e15a710..a57ae3e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.39) stable; urgency=low +hedera-web (1.405.40) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 2c737900..e4efe944 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.39", + "version": "1.405.40", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From a9dbef8be6eba5b21e2c627eef25c8b30efa688b Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 12 Dec 2017 10:19:38 +0100 Subject: [PATCH 18/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a57ae3e0..7a1085c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.40) stable; urgency=low +hedera-web (1.405.41) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index e4efe944..efd2ae56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.40", + "version": "1.405.41", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 7df8194db67d1b564e512f6daa9a4d7c5c9829ec Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 12 Dec 2017 10:21:27 +0100 Subject: [PATCH 19/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7a1085c1..e71d9725 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.41) stable; urgency=low +hedera-web (1.405.42) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index efd2ae56..16a7161d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.41", + "version": "1.405.42", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From f394a35975c85a223d58d2cc86e1c7c2d8f40370 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 12 Dec 2017 13:01:01 +0100 Subject: [PATCH 20/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e71d9725..0b78e766 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.42) stable; urgency=low +hedera-web (1.405.43) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 16a7161d..8b149d1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.42", + "version": "1.405.43", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 2aad421b08b02595561131c176759008b4fffde1 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 12 Dec 2017 13:02:00 +0100 Subject: [PATCH 21/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b78e766..c4d2b1a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.43) stable; urgency=low +hedera-web (1.405.44) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 8b149d1e..44ef1206 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.43", + "version": "1.405.44", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 95a8efb8cf8ef23103c5633759e4b340710a6f50 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 12 Dec 2017 13:14:34 +0100 Subject: [PATCH 22/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c4d2b1a7..3a68a565 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.44) stable; urgency=low +hedera-web (1.405.46) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 44ef1206..3431598d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.44", + "version": "1.405.46", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 719c062eef46815f240ec41fa4d0d76a8c5ca5b8 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 13 Dec 2017 19:28:54 +0100 Subject: [PATCH 23/35] SMS bugs solved, refactor --- debian/changelog | 2 +- forms/ecomerce/catalog/catalog.js | 2 +- forms/ecomerce/confirm/ui.xml | 2 +- package.json | 2 +- rest/misc/sms.php | 45 ++++++++++++++----------------- web/service.php | 3 ++- 6 files changed, 26 insertions(+), 30 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3a68a565..18d9f50c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.46) stable; urgency=low +hedera-web (1.405.47) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js index 0326669f..ee6d7a77 100644 --- a/forms/ecomerce/catalog/catalog.js +++ b/forms/ecomerce/catalog/catalog.js @@ -303,7 +303,7 @@ Hedera.Catalog = new Class { var sql = ''; var batch = new Sql.Batch (); - var query = new Sql.String ({query: 'CALL basket_item_add (#warehouse, #item, #amount);'}); + var query = new Sql.String ({query: 'CALL basketAddItem (#warehouse, #item, #amount);'}); var amountSum = 0; for (var warehouse in this.items) diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index 54cc0894..bbf125a7 100644 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -25,7 +25,7 @@ - CALL basket_confirm () + CALL basketConfirm diff --git a/package.json b/package.json index 3431598d..2773895e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.46", + "version": "1.405.47", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/misc/sms.php b/rest/misc/sms.php index 17f000cc..e5f825e1 100644 --- a/rest/misc/sms.php +++ b/rest/misc/sms.php @@ -11,39 +11,34 @@ class Sms extends Vn\Web\JsonRequest function run ($db) { - $smsConfig = $db->getRow ('SELECT uri, user, password, title FROM sms_config'); + $smsConfig = $db->getObject ('SELECT uri, user, password, title FROM sms_config'); - $sClient = new SoapClient ($smsConfig['uri']); + $sClient = new SoapClient ($smsConfig->uri); $xmlString = $sClient->sendSMS ( - $smsConfig['user'] - ,$smsConfig['password'] - ,$smsConfig['title'] + $smsConfig->user + ,$smsConfig->password + ,$smsConfig->title ,$_REQUEST['to'] ,$_REQUEST['text'] ); $xmlResponse = new SimpleXMLElement ($xmlString); + $res = $xmlResponse->sms; - $customer = empty ($_REQUEST['customer']) ? NULL : $_REQUEST['customer']; + $db->query ( + 'INSERT INTO vn2008.sms (Id_trabajador, `text`, `to`, `from`, sent, response, Id_Cliente) + VALUES (account.userGetId(), #, #, #, #, #, #)', + [ + $_REQUEST['text'] + ,$_REQUEST['to'] + ,$_REQUEST['to'] + ,$res->codigo + ,$res->descripcion + ,empty ($_REQUEST['customer']) ? NULL : $_REQUEST['customer'] + ] + ); - try { - $sms = $xmlResponse->sms; - $db->query ( - 'INSERT INTO vn2008.sms (Id_trabajador, `text`, `to`, `from`, sent, response, Id_Cliente) - VALUES (account.userGetId(), #, #, #, #, #, #)', - [ - $_REQUEST['text'] - ,$_REQUEST['to'] - ,$_REQUEST['to'] - ,$sms->codigo - ,$sms->descripcion - ,$customer - ] - ); - } - catch (Exception $e) - { - trigger_error ($e->getMessage (), E_USER_WARNING); - } + if ($sms->codigo != 0) + throw new Lib\UserException ($res->descripcion); return TRUE; } diff --git a/web/service.php b/web/service.php index a74d4193..14fc9093 100644 --- a/web/service.php +++ b/web/service.php @@ -87,7 +87,8 @@ abstract class Service if (isset ($_COOKIE['PHPSESSID']) || isset ($_SESSION['access']) - || isset ($_SESSION['skipVisit'])) + || isset ($_SESSION['skipVisit']) + || !isset ($_SERVER['HTTP_USER_AGENT'])) return; $agent = $_SERVER['HTTP_USER_AGENT']; From 7ce6571770d3417dbc57613c7e41cb2862336940 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 13 Dec 2017 19:46:54 +0100 Subject: [PATCH 24/35] SMS bugs solved --- debian/changelog | 2 +- package.json | 2 +- rest/misc/sms.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18d9f50c..fb022fba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.47) stable; urgency=low +hedera-web (1.405.48) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 2773895e..b1ec2f9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.47", + "version": "1.405.48", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/misc/sms.php b/rest/misc/sms.php index e5f825e1..529d0ddf 100644 --- a/rest/misc/sms.php +++ b/rest/misc/sms.php @@ -37,7 +37,7 @@ class Sms extends Vn\Web\JsonRequest ] ); - if ($sms->codigo != 0) + if ($res->codigo != 0) throw new Lib\UserException ($res->descripcion); return TRUE; From 5897197b8942deb3aa4176786aedc1e1de5956fc Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 14 Dec 2017 15:33:48 +0100 Subject: [PATCH 25/35] Debt bugs solved, code unified. --- debian/changelog | 2 +- forms/ecomerce/confirm/ui.xml | 2 +- forms/ecomerce/orders/orders.js | 6 +++--- forms/ecomerce/orders/ui.xml | 28 +++++++++++----------------- package.json | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index fb022fba..61248dae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.48) stable; urgency=low +hedera-web (1.405.49) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index bbf125a7..b1403f9a 100644 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -7,7 +7,7 @@ SELECT o.id, o.date_send, o.note, o.company_id, ag.description agency, v.code method, ad.consignee, ad.zip_code, ad.city, ad.name address, - t.*, c.credit, customer_get_debt() debt + t.*, c.credit, clientGetDebt(NULL) debt FROM basket o JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id LEFT JOIN address_view ad ON ad.id = o.address_id diff --git a/forms/ecomerce/orders/orders.js b/forms/ecomerce/orders/orders.js index a4214ccd..cc1c6df6 100644 --- a/forms/ecomerce/orders/orders.js +++ b/forms/ecomerce/orders/orders.js @@ -17,14 +17,14 @@ Hedera.Orders = new Class ,onBasketClick: function () { - this.hash.set ({'form': 'ecomerce/basket'}); + this.hash.set ({form: 'ecomerce/basket'}); } ,repeaterFunc: function (res, form) { res.$('link').href = this.hash.make ({ - 'form': 'ecomerce/ticket', - 'ticket': form.get ('ticket_id') + form: 'ecomerce/ticket', + ticket: form.get ('ticket_id') }); } diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml index 5aafbff0..4d57a3f7 100644 --- a/forms/ecomerce/orders/ui.xml +++ b/forms/ecomerce/orders/ui.xml @@ -1,13 +1,4 @@ - - - - CALL customer_get_debt_by_company (); - SELECT -amount amount FROM t_customer_debt; - DROP TEMPORARY TABLE t_customer_debt; - - -

LastOrders

@@ -28,16 +19,19 @@ Balance: - - + conditional-func="balanceConditionalFunc" + column="debt"> + + + + SELECT clientGetDebt(NULL) debt + + + - + Date: Thu, 14 Dec 2017 15:56:17 +0100 Subject: [PATCH 26/35] Version increased --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 61248dae..60bfad96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.49) stable; urgency=low +hedera-web (1.405.50) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 30a4eaa7..a8e60b77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.49", + "version": "1.405.50", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 3026333088dd087b0dda7df06b5d1697ff4a0d14 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 18 Dec 2017 14:35:16 +0100 Subject: [PATCH 27/35] Extract locale script, refactor --- .eslintrc.yml | 4 ++ debian/changelog | 2 +- package.json | 5 ++- rest/core/locale/en.json | 5 +++ rest/dms/invoice.sql | 2 +- utils/extract-locale.js | 88 ++++++++++++++++++++++++++++++++++++++++ webpack.config.js | 30 +++++++------- 7 files changed, 118 insertions(+), 18 deletions(-) create mode 100644 rest/core/locale/en.json create mode 100644 utils/extract-locale.js diff --git a/.eslintrc.yml b/.eslintrc.yml index 0fe49c2b..cbeacb9c 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,4 +1,8 @@ extends: eslint:recommended +env: + es6: true +parserOptions: + sourceType: module rules: no-undef: 0 no-redeclare: 0 diff --git a/debian/changelog b/debian/changelog index 60bfad96..df3f3bf1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.50) stable; urgency=low +hedera-web (1.405.51) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index a8e60b77..5cf1e070 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.50", + "version": "1.405.51", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { @@ -8,11 +8,14 @@ "url": "https://git.verdnatura.es/hedera-web" }, "devDependencies": { + "archiver": "^2.1.0", "assets-webpack-plugin": "^3.5.1", "bundle-loader": "^0.5.4", "css-loader": "^0.25.0", "eslint": "^3.16.1", "file-loader": "^0.9.0", + "fs-extra": "^5.0.0", + "glob": "^7.1.2", "json-loader": "^0.5.4", "raw-loader": "^0.5.1", "style-loader": "^0.19.0", diff --git a/rest/core/locale/en.json b/rest/core/locale/en.json new file mode 100644 index 00000000..75f9e384 --- /dev/null +++ b/rest/core/locale/en.json @@ -0,0 +1,5 @@ +{ + "InvalidAction": "Invalid action" + + ,"EmptyQuery": "Empty query" +} diff --git a/rest/dms/invoice.sql b/rest/dms/invoice.sql index 71e43303..f3249727 100644 --- a/rest/dms/invoice.sql +++ b/rest/dms/invoice.sql @@ -1,5 +1,5 @@ -SELECT CONCAT_WS('/', c.pdfs_dir, invoice_get_path (#invoice)) +SELECT CONCAT_WS('/', c.pdfs_dir, invoiceGetPath(#invoice)) FROM config c JOIN invoice_view i WHERE i.invoice_id = #invoice diff --git a/utils/extract-locale.js b/utils/extract-locale.js new file mode 100644 index 00000000..d6cac973 --- /dev/null +++ b/utils/extract-locale.js @@ -0,0 +1,88 @@ +var glob = require('glob'); +var fs = require('fs-extra'); +var path = require('path'); +var archiver = require('archiver'); + +let lang = process.argv[2]; + +if (lang == null) +{ + let baseName = path.basename(process.argv[1]); + console.log(`Usage: ${baseName} language_code`); + process.exit(1); +} + +let nDirs; +let projectDir; + +fs.remove(lang, () => { + fs.realpath(`${__dirname}/..`, (err, realPath) => { + projectDir = realPath; + let len = projectDir.length + 1; + + glob(`${projectDir}/**/locale/`, (err, localeDirs) => { + nDirs = localeDirs.length * 2; + + for (let localeDir of localeDirs) { + localeDir = localeDir.substr(len) + + if (/^node_modules\//.test (localeDir)) + continue; + + exportLocale(localeDir); + } + }) + }); +}); + +function exportLocale (localeDir) { + let dstDir = `${lang}/${localeDir}`; + + fs.mkdirp(dstDir, err => { + if (err) { + onError(err); + return; + } + + let src, dst; + + src = `${projectDir}/${localeDir}/en.json`; + dst = `${dstDir}/en.json`; + fs.copy(src, dst, onDirEnd); + + src = `${projectDir}/${localeDir}/${lang}.json`; + dst = `${dstDir}/${lang}.json`; + fs.copy(src, dst, onDirEnd); + }); +} + +function onError (err) { + console.log(err); + onDirEnd(); +} + +let output; +let archive; + +function onDirEnd() { + nDirs--; + if (nDirs > 0) return; + + output = fs.createWriteStream(`${lang}.zip`); + output.on ('close', onArchiveEnd); + + archive = archiver('zip', { + zlib: { level: 9 } + }); + archive.on ('error', err => { + throw err; + }); + archive.pipe(output); + archive.directory(lang); + archive.finalize(); +} + +function onArchiveEnd() { + fs.remove(lang); + console.log ('Export finalized!'); +} diff --git a/webpack.config.js b/webpack.config.js index e3a19003..9139ef47 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,12 +1,12 @@ -var path = require ('path'); -var webpack = require ('webpack'); -var AssetsWebpackPlugin = require ('assets-webpack-plugin'); -var WebpackChunkHash = require ('webpack-chunk-hash'); -var merge = require ('webpack-merge'); -var wpConfig = require ('./webpack.config.json'); +var path = require('path'); +var webpack = require('webpack'); +var AssetsWebpackPlugin = require('assets-webpack-plugin'); +var WebpackChunkHash = require('webpack-chunk-hash'); +var merge = require('webpack-merge'); +var wpConfig = require('./webpack.config.json'); var devMode = process.env.NODE_ENV !== 'production'; -var outputPath = path.join (__dirname, wpConfig.buildDir); +var outputPath = path.join(__dirname, wpConfig.buildDir); var publicPath = wpConfig.buildDir +'/'; var baseConfig = { @@ -34,12 +34,12 @@ var baseConfig = { __dirname: true }, plugins: [ - new webpack.DefinePlugin ({ + new webpack.DefinePlugin({ _DEV_MODE: devMode, _DEV_SERVER_PORT: wpConfig.devServerPort, _PUBLIC_PATH: JSON.stringify (publicPath) }), - new webpack.optimize.CommonsChunkPlugin ({ + new webpack.optimize.CommonsChunkPlugin({ names: ['vendor', 'manifest'] }) ], @@ -54,15 +54,15 @@ var prodConfig = { chunkFilename: 'chunk.[id].[chunkhash].js' }, plugins: [ - new webpack.optimize.UglifyJsPlugin ({ + new webpack.optimize.UglifyJsPlugin({ minimize: true, compress: { warnings: false } }), - new AssetsWebpackPlugin ({ + new AssetsWebpackPlugin({ path: outputPath }), - new webpack.HashedModuleIdsPlugin (), - new WebpackChunkHash () + new webpack.HashedModuleIdsPlugin(), + new WebpackChunkHash() ], devtool: 'source-map' }; @@ -73,7 +73,7 @@ var devConfig = { chunkFilename: 'chunk.[id].js' }, plugins: [ - new webpack.NamedModulesPlugin () + new webpack.NamedModulesPlugin() ], devServer: { host: '0.0.0.0', @@ -85,4 +85,4 @@ var devConfig = { }; var mrgConfig = devMode ? devConfig : prodConfig; -module.exports = merge (baseConfig, mrgConfig); +module.exports = merge(baseConfig, mrgConfig); From e0ced87f7c9c462314ce34e36cdae1055e67a792 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 18 Dec 2017 14:42:05 +0100 Subject: [PATCH 28/35] Version incremented --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index df3f3bf1..0243479a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.51) stable; urgency=low +hedera-web (1.405.52) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 5cf1e070..fbb41034 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.51", + "version": "1.405.52", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 723b584af95f04a3f579af8bc5079e93b9777e25 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 19 Dec 2017 10:08:11 +0100 Subject: [PATCH 29/35] SMS bugs solved --- debian/changelog | 2 +- package.json | 2 +- rest/dms/invoice.php | 3 ++- rest/misc/sms.php | 33 +++++++++++++++++++++------------ 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0243479a..dbc862d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.52) stable; urgency=low +hedera-web (1.405.53) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index fbb41034..96751192 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.52", + "version": "1.405.53", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/dms/invoice.php b/rest/dms/invoice.php index 78548d38..1b2e9cad 100644 --- a/rest/dms/invoice.php +++ b/rest/dms/invoice.php @@ -2,6 +2,7 @@ use Vn\Web\Security; use Vn\Web\Util; +use Vn\Lib; class Invoice extends Vn\Web\RestRequest { @@ -14,7 +15,7 @@ class Invoice extends Vn\Web\RestRequest ['invoice' => (int) $_GET['invoice']]); if (!$pdfPath) - throw new Exception (s('Invoice id not found')); + throw new Lib\UserException (s('Invoice id not found')); Util::printFile ($pdfPath); } diff --git a/rest/misc/sms.php b/rest/misc/sms.php index 529d0ddf..8b329ca8 100644 --- a/rest/misc/sms.php +++ b/rest/misc/sms.php @@ -5,39 +5,48 @@ use Vn\Lib; class Sms extends Vn\Web\JsonRequest { const PARAMS = [ - 'to' - ,'text' + 'destination' + ,'message' + ]; + + const OK_STATES = [ + 0, // Ok + 127 // Processing ]; function run ($db) { - $smsConfig = $db->getObject ('SELECT uri, user, password, title FROM sms_config'); + $smsConfig = $db->getObject ('SELECT uri, user, password, title FROM vn.smsConfig'); $sClient = new SoapClient ($smsConfig->uri); $xmlString = $sClient->sendSMS ( $smsConfig->user ,$smsConfig->password ,$smsConfig->title - ,$_REQUEST['to'] - ,$_REQUEST['text'] + ,$_REQUEST['destination'] + ,$_REQUEST['message'] ); $xmlResponse = new SimpleXMLElement ($xmlString); $res = $xmlResponse->sms; $db->query ( - 'INSERT INTO vn2008.sms (Id_trabajador, `text`, `to`, `from`, sent, response, Id_Cliente) - VALUES (account.userGetId(), #, #, #, #, #, #)', + 'INSERT INTO vn.sms SET + `senderFk` = account.userGetId(), + `destinationFk` = #, + `destination` = #, + `message` = #, + `statusCode` = #, + `status` = #', [ - $_REQUEST['text'] - ,$_REQUEST['to'] - ,$_REQUEST['to'] + empty ($_REQUEST['destinationId']) ? NULL : $_REQUEST['destinationId'] + ,$_REQUEST['destination'] + ,$_REQUEST['message'] ,$res->codigo ,$res->descripcion - ,empty ($_REQUEST['customer']) ? NULL : $_REQUEST['customer'] ] ); - if ($res->codigo != 0) + if (!in_array ($res->codigo, self::OK_STATES)) throw new Lib\UserException ($res->descripcion); return TRUE; From 726b22dc73463e7810bd395aa7cd0967ca872425 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 19 Dec 2017 10:24:21 +0100 Subject: [PATCH 30/35] SMS bugs solved --- debian/changelog | 2 +- package.json | 2 +- rest/misc/sms.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index dbc862d8..b819afc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.53) stable; urgency=low +hedera-web (1.405.54) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 96751192..aa1707c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.53", + "version": "1.405.54", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/misc/sms.php b/rest/misc/sms.php index 8b329ca8..9361a94c 100644 --- a/rest/misc/sms.php +++ b/rest/misc/sms.php @@ -11,7 +11,7 @@ class Sms extends Vn\Web\JsonRequest const OK_STATES = [ 0, // Ok - 127 // Processing + 200 // Processing ]; function run ($db) @@ -46,7 +46,7 @@ class Sms extends Vn\Web\JsonRequest ] ); - if (!in_array ($res->codigo, self::OK_STATES)) + if (!in_array ((int) $res->codigo, self::OK_STATES)) throw new Lib\UserException ($res->descripcion); return TRUE; From 372bb33909a722829f71323474144aee36c11255 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 20 Dec 2017 12:34:04 +0100 Subject: [PATCH 31/35] Refactor --- debian/changelog | 2 +- forms/admin/photos/ui.xml | 2 +- forms/cms/home/ui.xml | 9 ++------- forms/cms/training/ui.xml | 6 +++--- forms/news/new/new.js | 2 +- forms/news/new/ui.xml | 2 +- forms/news/news/ui.xml | 4 ++-- js/hedera/gui.js | 11 ++++++++--- js/hedera/tpv.js | 6 +++--- js/htk/field/image.js | 2 +- package.json | 2 +- rest/core/query.php | 16 ++++++++-------- rest/image/resize.php | 18 +++++++++--------- rest/image/thumb.php | 4 ++-- rest/image/upload.php | 2 +- rest/image/util.php | 6 +++--- rest/misc/contact.php | 18 +++++++++--------- rest/misc/production.php | 2 +- rest/tpv/confirm-mail.php | 22 +++++++++++----------- rest/tpv/confirm-soap.php | 2 +- utils/extract-locale.js | 33 ++++++++++++++++----------------- web/mailer.php | 6 +++--- 22 files changed, 88 insertions(+), 89 deletions(-) diff --git a/debian/changelog b/debian/changelog index b819afc7..ffa34278 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.54) stable; urgency=low +hedera-web (1.405.55) stable; urgency=low * Initial Release. diff --git a/forms/admin/photos/ui.xml b/forms/admin/photos/ui.xml index a0a8ee1b..259aadfd 100644 --- a/forms/admin/photos/ui.xml +++ b/forms/admin/photos/ui.xml @@ -9,7 +9,7 @@ - SELECT name, `desc` FROM image_schema ORDER BY `desc` + SELECT name, `desc` FROM imageCollection ORDER BY `desc` diff --git a/forms/cms/home/ui.xml b/forms/cms/home/ui.xml index 8fa004a0..bae37fcd 100644 --- a/forms/cms/home/ui.xml +++ b/forms/cms/home/ui.xml @@ -14,9 +14,9 @@ - SELECT title, date_time, text, image, id FROM news + SELECT title, text, image, id FROM news WHERE tag != 'course' - ORDER BY priority, date_time DESC + ORDER BY priority, created DESC @@ -24,11 +24,6 @@

-
diff --git a/forms/cms/training/ui.xml b/forms/cms/training/ui.xml index 86efa1c7..969c3c17 100644 --- a/forms/cms/training/ui.xml +++ b/forms/cms/training/ui.xml @@ -7,9 +7,9 @@ - SELECT title, date_time, text, image, id FROM news + SELECT title, created, text, image, id FROM news WHERE tag = 'course' - ORDER BY priority, date_time DESC + ORDER BY priority, created DESC @@ -18,7 +18,7 @@

- +

diff --git a/forms/news/new/new.js b/forms/news/new/new.js index fd30aeb3..9a2b1099 100644 --- a/forms/news/new/new.js +++ b/forms/news/new/new.js @@ -11,7 +11,7 @@ Hedera.New = new Class ,activate: function () { this.$('model').mode = Db.Model.Mode.ON_DEMAND; - this.$('model').setDefault ('user_id', 'news', + this.$('model').setDefault ('userFk', 'news', new Sql.Function ({schema: 'account', name: 'userGetId'})); tinymce.init ({ diff --git a/forms/news/new/ui.xml b/forms/news/new/ui.xml index 9d66e02b..8ee6ecc9 100644 --- a/forms/news/new/ui.xml +++ b/forms/news/new/ui.xml @@ -46,7 +46,7 @@ - SELECT name, description FROM news_tag + SELECT name, description FROM newsTag ORDER BY description diff --git a/forms/news/news/ui.xml b/forms/news/news/ui.xml index 46e6342f..ecdc8d6a 100644 --- a/forms/news/news/ui.xml +++ b/forms/news/news/ui.xml @@ -15,8 +15,8 @@ SELECT n.id, u.nickname, priority, image, title FROM news n - JOIN account.user u ON u.id = n.user_id - ORDER BY priority, n.date_time DESC + JOIN account.user u ON u.id = n.userFk + ORDER BY priority, n.created DESC diff --git a/js/hedera/gui.js b/js/hedera/gui.js index 63da43f5..f1489792 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -56,7 +56,8 @@ module.exports = new Class this.$('social-bar').conn = this._conn; var sql = 'SELECT nickname FROM account.userView;' - +'SELECT default_form, image_dir, image_host FROM config;' + +'SELECT default_form, image_host FROM config;' + +'SELECT url FROM imageConfig;' +'SELECT production_domain, test_domain FROM config;'; this._conn.execQuery (sql, this.onMainQueryDone.bind (this)); @@ -147,6 +148,10 @@ module.exports = new Class // Retrieving configuration parameters + Vn.Config.imageUrl = resultSet.fetchValue (); + + // Retrieving configuration parameters + var res = resultSet.fetchResult (); if (res.next () && res.get ('test_domain')) @@ -175,7 +180,7 @@ module.exports = new Class ,loadMenu: function () { - var sql = 'CALL formList ()'; + var sql = 'SELECT * FROM myMenu'; this._conn.execQuery (sql, this._onMenuLoad.bind (this)); } @@ -189,7 +194,7 @@ module.exports = new Class if (res) for (var i = 0; res.next (); i++) { - var parent = res.get ('parent'); + var parent = res.get ('parentFk'); if (!sectionMap[parent]) sectionMap[parent] = []; diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js index ffdf6495..717e041b 100644 --- a/js/hedera/tpv.js +++ b/js/hedera/tpv.js @@ -81,9 +81,9 @@ module.exports = new Class var batch = new Sql.Batch (); batch.addValue ('transaction', parseInt (this.tpvOrder)); - var query = 'SELECT t.amount, m.company_id ' + var query = 'SELECT t.amount, m.companyFk ' +'FROM tpv_transaction_view t ' - +'JOIN tpv_merchant m ON t.merchant_id = m.id ' + +'JOIN tpvMerchant m ON m.id = t.merchant_id ' +'WHERE t.id = #transaction'; this.conn.execQuery (query, this._onRetryPayDone.bind (this), batch); @@ -94,7 +94,7 @@ module.exports = new Class var res = resultSet.fetchResult (); if (res.next ()) - this._realPay (res.get ('amount'), res.get ('company_id')); + this._realPay (res.get ('amount'), res.get ('companyFk')); else Htk.Toast.showError (_('AmountError')); } diff --git a/js/htk/field/image.js b/js/htk/field/image.js index 20b8c3f0..94dc3543 100644 --- a/js/htk/field/image.js +++ b/js/htk/field/image.js @@ -131,7 +131,7 @@ module.exports = new Class ,_makeSrc: function (subdir) { - var src = Vn.Config['image_dir'] +'/'; + var src = Vn.Config.imageUrl +'/'; if (this._directory) src += this._directory +'/'; diff --git a/package.json b/package.json index aa1707c5..f381da7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.54", + "version": "1.405.55", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/core/query.php b/rest/core/query.php index 1e3243c1..cce67e9b 100644 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -34,16 +34,16 @@ class Query extends Vn\Web\JsonRequest if ($db->checkWarnings () && ($result = $db->query ('SHOW WARNINGS'))) { - $sql = 'SELECT description, @warn code '. - 'FROM sql_message WHERE code = @warn'; + $sql = 'SELECT `description`, @warn `code` + FROM `message` WHERE `code` = @warn'; - while ($row = $result->fetch_assoc ()) + while ($row = $result->fetch_object ()) { - if ($row['Code'] == 1265 - && ($warning = $db->getRow ($sql))) - trigger_error ("{$warning['code']}: {$warning['description']}", E_USER_WARNING); + if ($row->Code == 1265 + && ($warning = $db->getObject ($sql))) + trigger_error ("{$warning->code}: {$warning->description}", E_USER_WARNING); else - trigger_error ("{$row['Code']}: {$row['Message']}", E_USER_WARNING); + trigger_error ("{$row->Code}: {$row->Message}", E_USER_WARNING); } } @@ -56,7 +56,7 @@ class Query extends Vn\Web\JsonRequest if ($e->getCode () == 1644) { $dbMessage = $e->getMessage (); - $sql = 'SELECT description FROM sql_message WHERE code = #'; + $sql = 'SELECT `description` FROM `message` WHERE `code` = #'; $message = $db->getValue ($sql, [$dbMessage]); if ($message) diff --git a/rest/image/resize.php b/rest/image/resize.php index 71ca0df0..2f7f4940 100644 --- a/rest/image/resize.php +++ b/rest/image/resize.php @@ -14,10 +14,10 @@ require_once (__DIR__.'/lib.php'); class Resize extends Vn\Lib\Method { const PARAMS = [ - 'src_dir' - ,'dst_dir' - ,'max_height' - ,'max_Width' + 'srcDir' + ,'dstDir' + ,'maxHeight' + ,'maxWidth' ,'rewrite' ,'crop' ,'symbolic' @@ -28,13 +28,13 @@ class Resize extends Vn\Lib\Method $options = getopt ('', $params); - if (!$this->checkParams ($options, self::PARAMS) + if (!$this->checkParams ($options, self::PARAMS)) $this->usage (); - $srcDir = $options['src_dir']; - $dstDir = $options['dst_dir']; - $maxHeight = $options['max_height']; - $maxWidth = $options['max_Width']; + $srcDir = $options['srcDir']; + $dstDir = $options['dstDir']; + $maxHeight = $options['maxHeight']; + $maxWidth = $options['maxWidth']; $rewrite = isset ($options['rewrite']); $crop = isset ($options['crop']); $symbolic = isset ($options['symbolic']); diff --git a/rest/image/thumb.php b/rest/image/thumb.php index 77db5872..29416e94 100644 --- a/rest/image/thumb.php +++ b/rest/image/thumb.php @@ -52,8 +52,8 @@ class Thumb extends Vn\Web\RestRequest $row = $db->getValue ( 'SELECT crop - FROM image_schema s - JOIN image_schema_size z ON z.image_schema_id = s.id + FROM imageCollection s + JOIN imageCollectionSize z ON z.collectionFk = s.id WHERE s.name = #schema AND z.width = #width AND z.height = #height' diff --git a/rest/image/upload.php b/rest/image/upload.php index 6f81ec07..5f76cde3 100644 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -86,7 +86,7 @@ class Upload extends Vn\Web\JsonRequest $symbolicSrc = "../full/$fileName"; $image = Image::create ($tmpName); - Image::resizeSave ($image, $fullFile, $info['max_height'], $info['max_width']); + Image::resizeSave ($image, $fullFile, $info['maxHeight'], $info['maxWidth']); foreach ($info['sizes'] as $size => $i) { diff --git a/rest/image/util.php b/rest/image/util.php index 3236bdd4..5a3cd615 100644 --- a/rest/image/util.php +++ b/rest/image/util.php @@ -26,8 +26,8 @@ class Util $db = $this->app->getSysConn (); $info = $db->getRow ( - 'SELECT id, max_width, max_height, `schema`, `table`, `column` - FROM image_schema WHERE name = #schema' + 'SELECT id, maxWidth, maxHeight, `schema`, `table`, `column` + FROM imageCollection WHERE name = #schema' ,['schema' => $schema] ); @@ -36,7 +36,7 @@ class Util $res = $db->query ( 'SELECT width, height, crop - FROM image_schema_size WHERE image_schema_id = #id' + FROM imageCollectionSize WHERE collectionFk = #id' ,['id' => $info['id']] ); diff --git a/rest/misc/contact.php b/rest/misc/contact.php index 87109b3b..15d8a87a 100644 --- a/rest/misc/contact.php +++ b/rest/misc/contact.php @@ -31,32 +31,32 @@ class Contact extends Vn\Web\JsonRequest //$db->queryFromFile (__DIR__.'/contact', $_REQUEST); //$customerId = $db->getValue ('SELECT @id'); - $conf = $db->getRow ( + $conf = $db->getObject ( 'SELECT m.host, m.port, m.secure, m.sender, m.user, m.password, c.recipient - FROM mail_config m JOIN contact c' + FROM mailConfig m JOIN contact c' ); $mail = new PHPMailer (); $mail->isSMTP (); - $mail->Host = $conf['host']; + $mail->Host = $conf->host; - if (!empty ($conf['user'])) + if (!empty ($conf->user)) { $mail->SMTPAuth = TRUE; - $mail->Username = $conf['user']; - $mail->Password = base64_decode ($conf['password']); + $mail->Username = $conf->user; + $mail->Password = base64_decode ($conf->password); } else $mail->SMTPAuth = FALSE; - if ($conf['secure']) + if ($conf->secure) { $mail->SMTPSecure = 'ssl'; $mail->Port = 465; } - $mail->setFrom ($conf['sender'], 'Web'); - $mail->addAddress ($conf['recipient']); + $mail->setFrom ($conf->sender, 'Web'); + $mail->addAddress ($conf->recipient); $mail->isHTML (TRUE); $mail->Subject = s('New customer request'); $mail->Body = '
'. print_r ($_REQUEST, TRUE) .'
'; diff --git a/rest/misc/production.php b/rest/misc/production.php index 18bf548d..62ee72b4 100644 --- a/rest/misc/production.php +++ b/rest/misc/production.php @@ -7,7 +7,7 @@ class Production extends Vn\Web\JsonRequest function run ($db) { $row = $db->getObject ( - 'SELECT displayText FROM production WHERE deviceId = #', + 'SELECT displayText FROM vn.routeGate WHERE deviceId = #', [$_REQUEST['deviceId']] ); diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php index be71416c..6c12a38c 100644 --- a/rest/tpv/confirm-mail.php +++ b/rest/tpv/confirm-mail.php @@ -10,17 +10,17 @@ class ConfirmMail extends Vn\Lib\Method function run ($db) { $imap = NULL; - $imapConf = $db->getRow ( - 'SELECT host, user, pass, clean_period, success_folder, error_folder - FROM tpv_imap_config' + $imapConf = $db->getObject ( + 'SELECT host, user, pass, cleanPeriod, successFolder, errorFolder + FROM tpvImapConfig' ); $mailbox = sprintf ('{%s/imap/ssl/novalidate-cert}', - $imapConf['host']); + $imapConf->host); $imap = imap_open ($mailbox - ,$imapConf['user'] - ,base64_decode ($imapConf['pass']) + ,$imapConf->user + ,base64_decode ($imapConf->pass) ); if (!$imap) @@ -61,9 +61,9 @@ class ConfirmMail extends Vn\Lib\Method // Moves the processed mail to another folder if ($success) - $folder = $imapConf['success_folder']; + $folder = $imapConf->successFolder; else - $folder = $imapConf['error_folder']; + $folder = $imapConf->errorFolder; if (!imap_mail_move ($imap, $msg, "$folder")) trigger_error (imap_last_error (), E_USER_WARNING); @@ -80,12 +80,12 @@ class ConfirmMail extends Vn\Lib\Method if (rand (1, 20) == 1) { $folders = array ( - $imapConf['success_folder'] - ,$imapConf['error_folder'] + $imapConf->successFolder + ,$imapConf->errorFolder ); $date = new \DateTime (NULL); - $date->sub (new \DateInterval ($imapConf['clean_period'])); + $date->sub (new \DateInterval ($imapConf->cleanPeriod)); $filter = sprintf ('BEFORE "%s"', $date->format('D, j M Y')); foreach ($folders as $folder) diff --git a/rest/tpv/confirm-soap.php b/rest/tpv/confirm-soap.php index 86a3b9c6..55d25a05 100644 --- a/rest/tpv/confirm-soap.php +++ b/rest/tpv/confirm-soap.php @@ -50,7 +50,7 @@ function procesaNotificacionSIS ($XML) $shaString = substr ($requestString, $start, $end - $start + 10); $key = $db->getValue ( - 'SELECT secret_key FROM tpv_merchant WHERE id = #' + 'SELECT secretKey FROM tpvMerchant WHERE id = #' ,[$params['Ds_MerchantCode']] ); diff --git a/utils/extract-locale.js b/utils/extract-locale.js index d6cac973..620f900b 100644 --- a/utils/extract-locale.js +++ b/utils/extract-locale.js @@ -12,7 +12,7 @@ if (lang == null) process.exit(1); } -let nDirs; +let nTasks; let projectDir; fs.remove(lang, () => { @@ -21,8 +21,6 @@ fs.remove(lang, () => { let len = projectDir.length + 1; glob(`${projectDir}/**/locale/`, (err, localeDirs) => { - nDirs = localeDirs.length * 2; - for (let localeDir of localeDirs) { localeDir = localeDir.substr(len) @@ -31,7 +29,9 @@ fs.remove(lang, () => { exportLocale(localeDir); } - }) + + nTasks = localeDirs.length; + }); }); }); @@ -40,7 +40,8 @@ function exportLocale (localeDir) { fs.mkdirp(dstDir, err => { if (err) { - onError(err); + console.log(err); + onTaskEnd(); return; } @@ -48,28 +49,26 @@ function exportLocale (localeDir) { src = `${projectDir}/${localeDir}/en.json`; dst = `${dstDir}/en.json`; - fs.copy(src, dst, onDirEnd); + fs.copy(src, dst, onTaskEnd); src = `${projectDir}/${localeDir}/${lang}.json`; dst = `${dstDir}/${lang}.json`; - fs.copy(src, dst, onDirEnd); - }); -} + fs.copy(src, dst, onTaskEnd); -function onError (err) { - console.log(err); - onDirEnd(); + nTasks += 2; + onTaskEnd(); + }); } let output; let archive; -function onDirEnd() { - nDirs--; - if (nDirs > 0) return; +function onTaskEnd() { + nTasks--; + if (nTasks > 0) return; output = fs.createWriteStream(`${lang}.zip`); - output.on ('close', onArchiveEnd); + output.on ('close', onArchiveClose); archive = archiver('zip', { zlib: { level: 9 } @@ -82,7 +81,7 @@ function onDirEnd() { archive.finalize(); } -function onArchiveEnd() { +function onArchiveClose() { fs.remove(lang); console.log ('Export finalized!'); } diff --git a/web/mailer.php b/web/mailer.php index 0b6b5f20..aeaba74c 100644 --- a/web/mailer.php +++ b/web/mailer.php @@ -13,8 +13,8 @@ class Mailer function __construct ($db) { $this->conf = $db->getObject ( - 'SELECT host, port, secure, sender, sender_name, user, password - FROM hedera.mail_config' + 'SELECT host, port, secure, sender, senderName, user, password + FROM hedera.mailConfig' ); } @@ -41,7 +41,7 @@ class Mailer $mail->Port = 465; } - $mail->setFrom ($conf->sender, $conf->sender_name); + $mail->setFrom ($conf->sender, $conf->senderName); $mail->IsHTML (TRUE); $mail->Subject = $subject; $mail->Body = $body; From f4372f8f5cdd011601984cec0126653146e064a0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 20 Dec 2017 15:47:46 +0100 Subject: [PATCH 32/35] TPV refactor --- debian/changelog | 2 +- js/hedera/tpv.js | 6 +++--- package.json | 2 +- rest/tpv/tpv.php | 2 +- rest/tpv/transaction.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index ffa34278..a8002a0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.55) stable; urgency=low +hedera-web (1.405.56) stable; urgency=low * Initial Release. diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js index 717e041b..82358c9f 100644 --- a/js/hedera/tpv.js +++ b/js/hedera/tpv.js @@ -17,7 +17,7 @@ module.exports = new Class batch.addValue ('transaction', this.tpvOrder); batch.addValue ('status', this.tpvStatus); - var query = 'CALL transactionEnd (#transaction, #status)'; + var query = 'CALL tpvTransactionEnd (#transaction, #status)'; this.conn.execQuery (query, null, batch); } @@ -82,8 +82,8 @@ module.exports = new Class batch.addValue ('transaction', parseInt (this.tpvOrder)); var query = 'SELECT t.amount, m.companyFk ' - +'FROM tpv_transaction_view t ' - +'JOIN tpvMerchant m ON m.id = t.merchant_id ' + +'FROM myTpvTransaction t ' + +'JOIN tpvMerchant m ON m.id = t.merchantFk ' +'WHERE t.id = #transaction'; this.conn.execQuery (query, this._onRetryPayDone.bind (this), batch); diff --git a/package.json b/package.json index f381da7d..41ca0a0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.55", + "version": "1.405.56", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/tpv/tpv.php b/rest/tpv/tpv.php index 99ac4fb9..e5b63cd2 100644 --- a/rest/tpv/tpv.php +++ b/rest/tpv/tpv.php @@ -20,7 +20,7 @@ class Tpv $error = NULL; return $db->query ( - 'CALL transactionConfirm (#, #, #, #, #, #)', + 'CALL tpvTransactionConfirm (#, #, #, #, #, #)', [ $params['Ds_Amount'] ,$params['Ds_Order'] diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php index 5a158898..293edf65 100644 --- a/rest/tpv/transaction.php +++ b/rest/tpv/transaction.php @@ -12,7 +12,7 @@ class Transaction extends Vn\Web\JsonRequest $amount = (int) $_REQUEST['amount']; $companyId = empty ($_REQUEST['company']) ? NULL : $_REQUEST['company']; - $row = $db->getObject ('CALL transactionStart (#, #)', + $row = $db->getObject ('CALL tpvTransactionStart (#, #)', [$amount, $companyId]); if (!isset ($row)) From a8619464128c6bce20c76ba1ddeefded2e7bc475 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 20 Dec 2017 17:18:57 +0100 Subject: [PATCH 33/35] Bugs solved --- debian/changelog | 2 +- js/hedera/gui.js | 2 +- package.json | 2 +- rest/image/thumb.php | 2 +- rest/image/upload.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index a8002a0a..5828b745 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.56) stable; urgency=low +hedera-web (1.405.57) stable; urgency=low * Initial Release. diff --git a/js/hedera/gui.js b/js/hedera/gui.js index f1489792..4b98622f 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -56,7 +56,7 @@ module.exports = new Class this.$('social-bar').conn = this._conn; var sql = 'SELECT nickname FROM account.userView;' - +'SELECT default_form, image_host FROM config;' + +'SELECT default_form FROM config;' +'SELECT url FROM imageConfig;' +'SELECT production_domain, test_domain FROM config;'; this._conn.execQuery (sql, this.onMainQueryDone.bind (this)); diff --git a/package.json b/package.json index 41ca0a0f..90c44e41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.56", + "version": "1.405.57", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/rest/image/thumb.php b/rest/image/thumb.php index 29416e94..2fad4584 100644 --- a/rest/image/thumb.php +++ b/rest/image/thumb.php @@ -82,7 +82,7 @@ class Thumb extends Vn\Web\RestRequest // Sends the thumb to the client - $useXsendfile = $db->getValue ('SELECT use_xsendfile FROM image_config'); + $useXsendfile = $db->getValue ('SELECT useXsendfile FROM imageConfig'); if ($useXsendfile) { diff --git a/rest/image/upload.php b/rest/image/upload.php index 5f76cde3..2d88cf18 100644 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -72,7 +72,7 @@ class Upload extends Vn\Web\JsonRequest throw new Lib\Exception (s($message)); } - $maxSize = $db->getValue ('SELECT max_size FROM image_config'); + $maxSize = $db->getValue ('SELECT maxSize FROM imageConfig'); if ($_FILES['image']['size'] > $maxSize * 1048576) throw new UserException (sprintf (s('File size error'), $maxSize)); From bc083a94e60da79b57b1cef43cf6607d250a96f4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 21 Dec 2017 16:33:51 +0100 Subject: [PATCH 34/35] Hook test --- debian/changelog | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5828b745..eb9bacbc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.57) stable; urgency=low +hedera-web (1.405.58) stable; urgency=low * Initial Release. diff --git a/package.json b/package.json index 90c44e41..74fd99db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.57", + "version": "1.405.58", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { From 52a0b588eca2b44d33284e1fcc28fe0cc4bc654f Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 2 Jan 2018 14:16:41 +0100 Subject: [PATCH 35/35] DB refactor --- debian/changelog | 2 +- forms/account/address-list/address-list.js | 12 +++--- forms/account/address-list/ui.xml | 24 ++++++------ forms/account/address/address.js | 4 +- forms/account/address/ui.xml | 29 ++++++++------- forms/account/conf/conf.js | 9 ++--- forms/account/conf/ui.xml | 18 ++------- forms/ecomerce/orders/orders.js | 2 +- forms/ecomerce/orders/ui.xml | 10 ++--- forms/ecomerce/ticket/locale/ca.json | 1 + forms/ecomerce/ticket/locale/en.json | 1 + forms/ecomerce/ticket/locale/es.json | 1 + forms/ecomerce/ticket/locale/fr.json | 1 + forms/ecomerce/ticket/locale/mn.json | 1 + forms/ecomerce/ticket/locale/pt.json | 1 + forms/ecomerce/ticket/ticket.js | 10 ++--- forms/ecomerce/ticket/ui.xml | 41 ++++++++------------- package.json | 2 +- reports/delivery-note/delivery-note.js | 6 +-- reports/delivery-note/style.css | 7 +++- reports/delivery-note/ui.xml | 43 +++++++++------------- 21 files changed, 98 insertions(+), 127 deletions(-) diff --git a/debian/changelog b/debian/changelog index eb9bacbc..54192a56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.58) stable; urgency=low +hedera-web (1.405.59) stable; urgency=low * Initial Release. diff --git a/forms/account/address-list/address-list.js b/forms/account/address-list/address-list.js index 86aeb89c..710fb324 100644 --- a/forms/account/address-list/address-list.js +++ b/forms/account/address-list/address-list.js @@ -5,15 +5,15 @@ Hedera.AddressList = new Class ,activate: function () { - this.$('user-model').setInfo ('c', 'customer_view', 'hedera'); - this.$('addresses').setInfo ('a', 'address_view', 'hedera'); + this.$('user-model').setInfo ('c', 'myClient', 'hedera'); + this.$('addresses').setInfo ('a', 'myAddress', 'hedera'); } ,onAddAddressClick: function () { this.hash.set ({ - 'form': 'account/address', - 'address': 0 + form: 'account/address', + address: 0 }); } @@ -34,8 +34,8 @@ Hedera.AddressList = new Class ,onEditAddressClick: function (button, form) { this.hash.set ({ - 'form': 'account/address', - 'address': form.get ('id') + form: 'account/address', + address: form.get ('id') }); } }); diff --git a/forms/account/address-list/ui.xml b/forms/account/address-list/ui.xml index b1203d3f..3baab1ed 100644 --- a/forms/account/address-list/ui.xml +++ b/forms/account/address-list/ui.xml @@ -3,19 +3,19 @@ - SELECT user_id, default_address - FROM customer_view c + SELECT id, defaultAddressFk + FROM myClient c - 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 + SELECT a.id, a.nickname, p.name province, a.postalCode, + a.city, a.street, a.active, c.country + FROM myAddress a + LEFT JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.country c ON c.id = p.countryFk + WHERE a.active != FALSE @@ -32,7 +32,7 @@
@@ -57,13 +57,13 @@ on-click="onEditAddressClick"/>

- +

- +

- , + ,

diff --git a/forms/account/address/address.js b/forms/account/address/address.js index bbd623a3..88ae18dc 100644 --- a/forms/account/address/address.js +++ b/forms/account/address/address.js @@ -5,8 +5,8 @@ Hedera.Address = new Class ,activate: function () { - this.$('model').setInfo ('a', 'address_view', 'hedera', ['id'], 'id'); - this.$('model').setDefault ('customer_id', 'a', + this.$('model').setInfo ('a', 'myAddress', 'hedera', ['id'], 'id'); + this.$('model').setDefault ('clientFk', 'a', new Sql.Function ({schema: 'account', name: 'userGetId'})); } diff --git a/forms/account/address/ui.xml b/forms/account/address/ui.xml index 750f37fe..0596de11 100644 --- a/forms/account/address/ui.xml +++ b/forms/account/address/ui.xml @@ -10,11 +10,12 @@ mode="ON_DEMAND" on-operations-done="onOperationsDone"> - SELECT a.id, a.name, a.consignee, a.city, a.zip_code, a.province_id, c.Id country_id - FROM address_view a - LEFT JOIN vn2008.province p ON p.province_id = a.province_id - JOIN vn2008.Paises c ON c.Id = p.Paises_Id - WHERE active != FALSE AND a.id = #address + SELECT a.id, a.street, a.nickname, a.city, + a.postalCode, a.provinceFk, c.id countryFk + FROM myAddress a + LEFT JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.country c ON c.id = p.countryFk + WHERE a.active AND a.id = #address @@ -42,11 +43,11 @@
- +
- +
@@ -54,7 +55,7 @@
- +
@@ -63,23 +64,23 @@ id="country" property="param" form="iter" - column="country_id" + column="countryFk" one-way="true"/> - SELECT Id, Pais FROM vn2008.Paises - ORDER BY Pais + SELECT id, country FROM vn.country + ORDER BY country
- + - SELECT province_id, name FROM vn2008.province - WHERE Paises_Id = #country + SELECT id, name FROM vn.province + WHERE countryFk = #country ORDER BY name diff --git a/forms/account/conf/conf.js b/forms/account/conf/conf.js index bedca053..95fb03a5 100644 --- a/forms/account/conf/conf.js +++ b/forms/account/conf/conf.js @@ -5,8 +5,7 @@ Hedera.Conf = new Class ,activate: function () { - this.$('user-model').setInfo ('c', 'customer_view', 'hedera'); - this.$('addresses').setInfo ('a', 'address_view', 'hedera'); + this.$('user-model').setInfo ('c', 'myClient', 'hedera'); } ,onPassChangeClick: function () @@ -38,8 +37,8 @@ Hedera.Conf = new Class throw new Error (_('Passwords doesn\'t match')); var params = { - 'oldPassword': oldPassword, - 'newPassword': newPassword + oldPassword: oldPassword, + newPassword: newPassword }; this.conn.send ('core/change-password', params, this._onPassChange.bind (this)); @@ -72,7 +71,7 @@ Hedera.Conf = new Class ,onAddressesClick: function () { - this.hash.set ({'form': 'account/address-list'}); + this.hash.set ({form: 'account/address-list'}); } }); diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml index 49e8405a..c4d51e37 100644 --- a/forms/account/conf/ui.xml +++ b/forms/account/conf/ui.xml @@ -12,23 +12,13 @@ SELECT u.id, u.name, u.email, u.recoverPass, - u.nickname, u.lang, c.mail, c.user_id + u.nickname, u.lang, c.isToBeMailed, c.id clientFk FROM account.userView u - LEFT JOIN customer_view c - ON u.id = c.user_id + LEFT JOIN myClient c + ON u.id = c.id - - - 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 - -

Configuration

@@ -70,7 +60,7 @@
- +
diff --git a/forms/ecomerce/orders/orders.js b/forms/ecomerce/orders/orders.js index cc1c6df6..c1ecdef3 100644 --- a/forms/ecomerce/orders/orders.js +++ b/forms/ecomerce/orders/orders.js @@ -24,7 +24,7 @@ Hedera.Orders = new Class { res.$('link').href = this.hash.make ({ form: 'ecomerce/ticket', - ticket: form.get ('ticket_id') + ticket: form.get ('id') }); } diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml index 4d57a3f7..d4ea7df6 100644 --- a/forms/ecomerce/orders/ui.xml +++ b/forms/ecomerce/orders/ui.xml @@ -44,7 +44,7 @@ - CALL ticket_list (); + CALL myTicketList (NULL, NULL); @@ -53,16 +53,16 @@

- +

- @ + @

- +

- +

diff --git a/forms/ecomerce/ticket/locale/ca.json b/forms/ecomerce/ticket/locale/ca.json index fe99237b..eade92a5 100644 --- a/forms/ecomerce/ticket/locale/ca.json +++ b/forms/ecomerce/ticket/locale/ca.json @@ -5,6 +5,7 @@ ,"Delivery": "Entrega" ,"Total": "Total" + ,"Total + tax": "Total + IVA" ,"Tax base": "Base imposable" ,"VAT": "IVA" diff --git a/forms/ecomerce/ticket/locale/en.json b/forms/ecomerce/ticket/locale/en.json index dc7ccbf6..e151483b 100644 --- a/forms/ecomerce/ticket/locale/en.json +++ b/forms/ecomerce/ticket/locale/en.json @@ -5,6 +5,7 @@ ,"Delivery": "Delivery" ,"Total": "Total" + ,"Total + tax": "Total + tax" ,"Tax base": "Tax base" ,"VAT": "VAT" diff --git a/forms/ecomerce/ticket/locale/es.json b/forms/ecomerce/ticket/locale/es.json index be06236d..76094125 100644 --- a/forms/ecomerce/ticket/locale/es.json +++ b/forms/ecomerce/ticket/locale/es.json @@ -5,6 +5,7 @@ ,"Delivery": "Entrega" ,"Total": "Total" + ,"Total + tax": "Total + IVA" ,"Tax base": "Base imponible" ,"VAT": "IVA" diff --git a/forms/ecomerce/ticket/locale/fr.json b/forms/ecomerce/ticket/locale/fr.json index 4f30ab04..37a2d6d5 100644 --- a/forms/ecomerce/ticket/locale/fr.json +++ b/forms/ecomerce/ticket/locale/fr.json @@ -5,6 +5,7 @@ ,"Delivery": "Livraison" ,"Total": "Total" + ,"Total + tax": "Total + impôt" ,"Tax base": "Imposable" ,"VAT": "TVA" diff --git a/forms/ecomerce/ticket/locale/mn.json b/forms/ecomerce/ticket/locale/mn.json index dc7ccbf6..e151483b 100644 --- a/forms/ecomerce/ticket/locale/mn.json +++ b/forms/ecomerce/ticket/locale/mn.json @@ -5,6 +5,7 @@ ,"Delivery": "Delivery" ,"Total": "Total" + ,"Total + tax": "Total + tax" ,"Tax base": "Tax base" ,"VAT": "VAT" diff --git a/forms/ecomerce/ticket/locale/pt.json b/forms/ecomerce/ticket/locale/pt.json index 486f2eb8..eacbcf8b 100644 --- a/forms/ecomerce/ticket/locale/pt.json +++ b/forms/ecomerce/ticket/locale/pt.json @@ -5,6 +5,7 @@ ,"Delivery": "Entrega" ,"Total": "Total" + ,"Total + tax": "Total + imposto" ,"Tax base": "Tributável" ,"VAT": "IVA" diff --git a/forms/ecomerce/ticket/ticket.js b/forms/ecomerce/ticket/ticket.js index 859bc98a..2cfcf4fe 100644 --- a/forms/ecomerce/ticket/ticket.js +++ b/forms/ecomerce/ticket/ticket.js @@ -10,10 +10,10 @@ Hedera.Ticket = new Class var batch = new Sql.Batch (); batch.addValue ('ticket', ticket.value); - this.conn.execQuery ('CALL ticketLog (#ticket)', null, batch); + this.conn.execQuery ('CALL myTicketLogAccess (#ticket)', null, batch); } - ,onPrintClick: function (event) + ,onPrintClick: function () { var batch = new Sql.Batch (); batch.addValue ('ticket', this.$('ticket-id').value); @@ -34,11 +34,7 @@ Hedera.Ticket = new Class { var price = form.get ('price'); var discount = form.get ('discount'); - - if (price && form.get ('fixed')) - return form.get ('amount') * price * ((100 - discount) / 100); - else - return null; + return form.get ('quantity') * price * ((100 - discount) / 100); } }); diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml index 8732530e..2f52b77d 100644 --- a/forms/ecomerce/ticket/ui.xml +++ b/forms/ecomerce/ticket/ui.xml @@ -5,13 +5,7 @@ - SELECT t.id, date, a.Agencia, note, p.name province, - zip_code, city, c.name, consignee, invoice, delivery - FROM ticket_view t - JOIN address_view c ON t.address_id = c.id - JOIN vn2008.Agencias a ON t.agency_id = a.Id_Agencia - JOIN vn2008.province p ON c.province_id = p.province_id - WHERE t.id = #ticket + CALL myTicketGet (#ticket) @@ -38,21 +32,21 @@

- +

- Delivery + Delivery

- +

- +

- + ()

@@ -60,23 +54,18 @@

Total - - - + +

+

+ Total + tax +

- SELECT m.item_id, amount, concept, Categoria, Medida, Tallos, Color, - Abreviatura, IF(fixed != FALSE, price, NULL) price, fixed, discount - FROM ticket_row_view m - INNER JOIN vn2008.Articles a - ON m.item_id = a.Id_Article AND ticket_id = #ticket - LEFT JOIN vn2008.Origen o - ON a.id_origen = o.id - ORDER BY concept + CALL myTicketGetRows (#ticket) @@ -88,11 +77,11 @@

- - + +

- x + x

diff --git a/package.json b/package.json index 74fd99db..5912c479 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.58", + "version": "1.405.59", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/reports/delivery-note/delivery-note.js b/reports/delivery-note/delivery-note.js index ead9ba53..3a708bdc 100644 --- a/reports/delivery-note/delivery-note.js +++ b/reports/delivery-note/delivery-note.js @@ -12,10 +12,6 @@ Hedera.DeliveryNote = new Class { var price = form.get ('price'); var discount = form.get ('discount'); - - if (price && form.get ('fixed')) - return form.get ('amount') * price * ((100 - discount) / 100); - else - return null; + return form.get ('quantity') * price * ((100 - discount) / 100); } }); diff --git a/reports/delivery-note/style.css b/reports/delivery-note/style.css index 3c96c9af..66a8d98f 100644 --- a/reports/delivery-note/style.css +++ b/reports/delivery-note/style.css @@ -21,13 +21,16 @@ h2 text-align: right; margin: .1em 0; } -.footer +.important { font-size: 1.2em; font-weight: bold; + text-align: right; +} +.footer +{ margin-top: .2em; border-top: 1px solid #333; padding-top: .3em; - text-align: right; } diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml index e92107b1..c99fa713 100644 --- a/reports/delivery-note/ui.xml +++ b/reports/delivery-note/ui.xml @@ -3,13 +3,7 @@ - SELECT t.id, date, a.Agencia, note, p.name province, - zip_code, city, c.name, consignee, invoice - FROM ticket_view t - JOIN address_view c ON t.address_id = c.id - JOIN vn2008.Agencias a ON t.agency_id = a.Id_Agencia - JOIN vn2008.province p ON c.province_id = p.province_id - WHERE t.id = #ticket + CALL myTicketGet (#ticket) @@ -20,48 +14,45 @@

- +

- +

- +

- + - () + () aaa

- Delivery + Delivery

- SELECT m.item_id, amount, concept, Categoria, Medida, Tallos, Color, - Abreviatura, IF(fixed != FALSE, price, NULL) price, fixed, discount - FROM ticket_row_view m - INNER JOIN vn2008.Articles a - ON m.item_id = a.Id_Article AND ticket_id = #ticket - LEFT JOIN vn2008.Origen o - ON a.id_origen = o.id - ORDER BY concept + CALL myTicketGetRows (#ticket) - - + + - - + + - +

+ Total + tax + +