#4365 Fixes & refactor
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-10-05 10:49:54 +02:00
parent bf5ad50f94
commit 1e514ab12a
7 changed files with 19 additions and 23 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.408.15) stable; urgency=low
hedera-web (1.408.16) stable; urgency=low
* Initial Release.

View File

@ -1,6 +1,5 @@
Hedera.AddressList = new Class
({
Hedera.AddressList = new Class({
Extends: Hedera.Form
,activate: function() {

View File

@ -2,20 +2,16 @@
<vn-group>
<db-form id="user-form">
<db-model property="model" id="user-model" updatable="true">
<custom>
SELECT id, defaultAddressFk
FROM myClient c
</custom>
SELECT id, defaultAddressFk
FROM myClient c
</db-model>
</db-form>
<db-model id="addresses" updatable="true">
<custom>
SELECT a.id, a.nickname, p.name province, a.postalCode,
a.city, a.street, a.isActive
FROM myAddress a
LEFT JOIN vn.province p ON p.id = a.provinceFk
WHERE a.isActive
</custom>
SELECT a.id, a.nickname, p.name province, a.postalCode,
a.city, a.street, a.isActive
FROM myAddress a
LEFT JOIN vn.province p ON p.id = a.provinceFk
WHERE a.isActive
</db-model>
</vn-group>
<div id="title">

View File

@ -118,9 +118,9 @@
<db-model property="model" id="addresses">
SELECT a.id, a.nickname, p.name province, a.city, a.street, a.isActive, 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.isActive
LEFT JOIN vn.province p ON p.id = a.provinceFk
JOIN vn.country c ON c.id = p.countryFk
WHERE a.isActive
</db-model>
<custom>
<div

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.408.15",
"version": "1.408.16",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -3,6 +3,7 @@
namespace Vn\Web;
use Vn\Lib;
use Vn\Lib\Locale;
/**
* Base class for JSON application.
@ -50,7 +51,7 @@ class JsonService extends RestService {
if (_ENABLE_DEBUG || $errno & $eUser)
$json->message = $message;
else
$json->message = \s('Something went wrong');
$json->message = s('Something went wrong');
if (_ENABLE_DEBUG) {
$json->code = $errno;
@ -80,7 +81,7 @@ class JsonService extends RestService {
$json->message = $e->getMessage();
} else {
$json->exception = 'Exception';
$json->message = \s('Something went wrong');
$json->message = s('Something went wrong');
}
if (_ENABLE_DEBUG) {

View File

@ -34,7 +34,7 @@ class RestService extends Service {
$isAuthorized = $db->getValue('SELECT myUser_checkRestPriv(#)',
[$_REQUEST['method']]);
if (!$isAuthorized)
throw new ForbiddenException(\s('You don\'t have enough privileges'));
throw new ForbiddenException(s('You don\'t have enough privileges'));
if ($method::SECURITY == Security::DEFINER) {
$methodDb = $db;
@ -42,7 +42,7 @@ class RestService extends Service {
$methodDb = $this->getUserDb($_SESSION['user']);
if ($method::PARAMS !== NULL && !$method->checkParams($_REQUEST, $method::PARAMS))
throw new UserException (\s('Missing parameters'));
throw new UserException (s('Missing parameters'));
Locale::addPath('rest/'. dirname($_REQUEST['method']));
@ -52,7 +52,7 @@ class RestService extends Service {
$res = $method->run($methodDb);
} catch (Db\Exception $e) {
if ($e->getCode() == 1644)
throw new UserException(\s($e->getMessage()));
throw new UserException(s($e->getMessage()));
}
if ($method::SECURITY == Security::DEFINER)