refs #4253 Translation & UI fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-01-16 13:59:11 +01:00
parent 87d75be910
commit 59ed61ae9b
53 changed files with 288 additions and 282 deletions

View File

@ -33,9 +33,9 @@ RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
> /etc/apt/sources.list.d/vn.list \ > /etc/apt/sources.list.d/vn.list \
&& apt-get update \ && apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
php-apcu \
php-image-text \ php-image-text \
php-text-captcha \ php-text-captcha \
php-apcu \
php-zip \ php-zip \
hedera-web \ hedera-web \
cron cron

2
debian/changelog vendored
View File

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

2
debian/control vendored
View File

@ -10,7 +10,7 @@ Vcs-Git: https://gitea.verdnatura.es/verdnatura/hedera-web
Package: hedera-web Package: hedera-web
Architecture: all Architecture: all
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
Suggests: php-text-captcha, php-zip, cron Suggests: php-image-text, php-text-captcha, php-zip, cron
Section: misc Section: misc
Priority: optional Priority: optional
Description: Verdnatura's web page Description: Verdnatura's web page

View File

@ -32,15 +32,18 @@ export default new Class({
var newPassword = this.$.newPassword.value; var newPassword = this.$.newPassword.value;
var repeatedPassword = this.$.repeatPassword.value; var repeatedPassword = this.$.repeatPassword.value;
if (newPassword == '' && repeatedPassword == '') try {
throw new Error(_('Passwords empty')); if (newPassword == '' && repeatedPassword == '')
if (newPassword !== repeatedPassword) throw new Error(_('Passwords empty'));
throw new Error(_('Passwords doesn\'t match')); if (newPassword !== repeatedPassword)
throw new Error(_('Passwords doesn\'t match'));
} catch (err) {
return Htk.Toast.showError(err.message);
}
var verificationToken = this.hash.$.verificationToken; var verificationToken = this.hash.$.verificationToken;
var params = {newPassword}; var params = {newPassword};
let err;
try { try {
if (verificationToken) { if (verificationToken) {
params.verificationToken = verificationToken; params.verificationToken = verificationToken;
@ -51,8 +54,7 @@ export default new Class({
await this.conn.patch( await this.conn.patch(
`Accounts/${userId}/changePassword`, params); `Accounts/${userId}/changePassword`, params);
} }
} catch(e) { } catch(err) {
err = e;
Htk.Toast.showError(err.message); Htk.Toast.showError(err.message);
if (this.hash.$.verificationToken) if (this.hash.$.verificationToken)
@ -65,8 +67,8 @@ export default new Class({
this.$.changePassword.hide(); this.$.changePassword.hide();
this.hash.unset('verificationToken'); this.hash.unset('verificationToken');
await this.conn.open(this.gui.user.name, newPassword);
Htk.Toast.showMessage(_('Password changed!')); Htk.Toast.showMessage(_('Password changed!'));
this.$.userForm.refresh();
} }
,onPassInfoClick() { ,onPassInfoClick() {

View File

@ -106,25 +106,23 @@ export default new Class({
Vn.Node.addClass(this.$[id], 'selected'); Vn.Node.addClass(this.$[id], 'selected');
}, },
disableButtons(disable) {
this.$.modify.disabled = disable;
this.$.confirm.disabled = disable;
},
onModifyClick() { onModifyClick() {
window.history.back(); window.history.back();
}, },
async onConfirmClick() { async onConfirmClick() {
this.disableButtons(true); this.disableButtons(true);
await this.$.confirmQuery.execute(); try {
await this.conn.execQuery('CALL myBasket_confirm');
this.$.successDialog.show();
} finally {
this.disableButtons(false);
}
}, },
onConfirm(query, resultSet) { disableButtons(disable) {
this.disableButtons(false); this.$.modify.disabled = disable;
this.$.confirm.disabled = disable;
if (resultSet.fetchResult())
this.$.successDialog.show();
}, },
async onDialogResponse() { async onDialogResponse() {

View File

@ -23,9 +23,6 @@
tmp.orderTax; tmp.orderTax;
</db-model> </db-model>
</db-form> </db-form>
<db-query id="confirm-query" on-ready="onConfirm">
CALL myBasket_confirm
</db-query>
</vn-group> </vn-group>
<div id="title"> <div id="title">
<h1><t>Order summary</t></h1> <h1><t>Order summary</t></h1>

View File

@ -222,8 +222,8 @@ module.exports = new Class({
Htk.Toast.showError(_('You don\'t have enough privileges')); Htk.Toast.showError(_('You don\'t have enough privileges'));
else { else {
switch (err.exception) { switch (err.exception) {
case 'UserDisabled': case 'UserDisabledError':
case 'OutdatedVersion': case 'OutdatedVersionError':
return; return;
} }
if (err.statusCode == 401) if (err.statusCode == 401)

View File

@ -50,19 +50,16 @@ module.exports = new Class({
this.doc.body.appendChild(this.node); this.doc.body.appendChild(this.node);
Htk.Toast.pushTop(this.$.formHolder); Htk.Toast.pushTop(this.$.formHolder);
await this.refreshUserData();
Vn.Node.setText(this.$.userName, this.user.nickname);
const resultSet = await this._conn.execQuery( const resultSet = await this._conn.execQuery(
'SELECT id, name, nickname FROM account.myUser;' 'SELECT defaultForm FROM config;'
+'SELECT defaultForm FROM config;'
+'SELECT url FROM imageConfig;' +'SELECT url FROM imageConfig;'
+'SELECT dbproduccion FROM vn.config;' +'SELECT dbproduccion FROM vn.config;'
+'SELECT productionDomain, testDomain FROM config;' +'SELECT productionDomain, testDomain FROM config;'
); );
// Retrieving the user name
this.user = resultSet.fetchObject();
Vn.Node.setText(this.$.userName, this.user.nickname);
// Retrieving configuration parameters // Retrieving configuration parameters
Vn.Config.defaultForm = resultSet.fetchValue(); Vn.Config.defaultForm = resultSet.fetchValue();
@ -120,6 +117,12 @@ module.exports = new Class({
} }
} }
,async refreshUserData() {
const resultSet = await this._conn.execQuery(
'SELECT id, name, nickname FROM account.myUser');
this.user = resultSet.fetchObject();
}
,async hide() { ,async hide() {
if (!this._shown) if (!this._shown)
return; return;
@ -474,11 +477,8 @@ module.exports = new Class({
this._conn.token = json; this._conn.token = json;
sessionStorage.setItem('supplantUser', supplantUser); sessionStorage.setItem('supplantUser', supplantUser);
const resultSet = await this._conn.execQuery( await this.refreshUserData();
'SELECT nickname FROM account.myUser'); Vn.Node.setText(this.$.supplanted, this.user.nickname);
const userName = resultSet.fetchValue();
Vn.Node.setText(this.$.supplanted, userName);
this.$.supplant.classList.toggle('show', true); this.$.supplant.classList.toggle('show', true);
await this.loadMenu(); await this.loadMenu();
} }
@ -492,6 +492,7 @@ module.exports = new Class({
sessionStorage.removeItem('supplantUser'); sessionStorage.removeItem('supplantUser');
this.$.supplant.classList.toggle('show', false); this.$.supplant.classList.toggle('show', false);
await this.refreshUserData();
await this.loadMenu(); await this.loadMenu();
this._onFormChange(); this._onFormChange();
} }

View File

@ -50,9 +50,8 @@ module.exports = new Class({
if (user !== null && user !== undefined) { if (user !== null && user !== undefined) {
params = { params = {
user: user, user,
password: pass, password: pass
remember: remember
}; };
} else } else
params = null; params = null;
@ -261,7 +260,7 @@ module.exports = new Class({
if (exception) { if (exception) {
exception = exception exception = exception
.replace(/\\/g, '.') .replace(/\\/g, '.')
.replace(/Exception$/, '') .replace(/Exception$/, 'Error')
.replace(/^Vn\.Web\./, ''); .replace(/^Vn\.Web\./, '');
err.exception = exception; err.exception = exception;

View File

@ -1,4 +1,3 @@
/** /**
* Holds a plain key-value javascript object and monitorizes changes over it. * Holds a plain key-value javascript object and monitorizes changes over it.
*/ */
@ -10,14 +9,14 @@ module.exports = new Class({
*/ */
params: { params: {
type: Object type: Object
} },
/** /**
* Shortcut for params property. * Shortcut for params property.
*/ */
,$: { $: {
type: Object type: Object
} }
} },
/** /**
* Gets a value from the lot. * Gets a value from the lot.
@ -25,9 +24,9 @@ module.exports = new Class({
* @param {string} field The field name * @param {string} field The field name
* @return {*} The field value * @return {*} The field value
*/ */
,get(field) { get(field) {
return this.params[field]; return this.params[field];
} },
/** /**
* Sets a value on the lot. * Sets a value on the lot.
@ -35,49 +34,51 @@ module.exports = new Class({
* @param {string} field The field name * @param {string} field The field name
* @param {*} value The new field value * @param {*} value The new field value
*/ */
,set(field, value) { set(field, value) {
var params = {}; this.assign({[field]: value});
params[field] = value; },
this.assign(params);
} unset(field) {
this.assign({[field]: undefined});
},
/** /**
* Returns an array with the lot keys. * Returns an array with the lot keys.
* *
* @return {Array} The lot keys * @return {Array} The lot keys
*/ */
,keys() {} keys() {},
/** /**
* Emits the 'change' signal on the lot. * Emits the 'change' signal on the lot.
* *
* @param {Object} changes The changed params and its values * @param {Object} changes The changed params and its values
*/ */
,changed(changes) { changed(changes) {
this.emit('change', changes); this.emit('change', changes);
} },
/** /**
* Copies all values from another lot. * Copies all values from another lot.
* *
* @param {Object} object The source object * @param {Object} object The source object
*/ */
,assign() {} assign() {},
/** /**
* Copies all values from another lot. * Copies all values from another lot.
* *
* @param {LotIface} lot The source lot * @param {LotIface} lot The source lot
*/ */
,assignLot(lot) { assignLot(lot) {
this.assign(lot.$); this.assign(lot.$);
} },
/** /**
* Resets all values. * Resets all values.
*/ */
,reset() { reset() {
this.params = {}; this.params = {};
} }
}); });

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Actualitza el teu navegador UpdateYourBrowser: Actualitza el teu navegador
ContinueAnyway: Continuar igualment ContinueAnyway: Continuar igualment
BrowserVersionNotCompatible: El vostre navegador no és compatible amb aquesta versió de la pàgina web
PushHereToInstallFirefox: Clica aquí per instal·lar Firefox

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Upgrade your browser UpdateYourBrowser: Upgrade your browser
ContinueAnyway: Continue anyway ContinueAnyway: Continue anyway
BrowserVersionNotCompatible: Your browser is not compatible with this version of the website
PushHereToInstallFirefox: Click here to install Firefox

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Actualiza tu navegador UpdateYourBrowser: Actualiza tu navegador
ContinueAnyway: Continuar de todos modos ContinueAnyway: Continuar de todos modos
BrowserVersionNotCompatible: Tu navegador no es compatible con esta versión de la página web
PushHereToInstallFirefox: Pulsa aquí para instalar Firefox

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Mettez à jour votre navigateur UpdateYourBrowser: Mettez à jour votre navigateur
ContinueAnyway: Continuer ContinueAnyway: Continuer
BrowserVersionNotCompatible: Votre navigateur n'est pas compatible avec cette version du site
PushHereToInstallFirefox: Cliquez ici pour installer Firefox

View File

@ -1,2 +0,0 @@
UpdateYourBrowser: Upgrade your browser
ContinueAnyway: Continue anyway

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Atualize seu navegador UpdateYourBrowser: Atualize seu navegador
ContinueAnyway: Continuar de todas maneiras ContinueAnyway: Continuar de todas maneiras
BrowserVersionNotCompatible: Seu navegador não é compatível com esta versão do site
PushHereToInstallFirefox: Clique aqui para instalar o Firefox

View File

@ -1,26 +1,53 @@
* * {
{
font-family: 'Roboto'; font-family: 'Roboto';
} }
img .box {
{ text-align: center;
position: absolute; margin: 0 auto;
margin-top: -200px; max-width: 380px;
margin-left: -200px; padding: 40px;
top: 50%; padding-bottom: 60px;
left: 50%;
} }
#continue .logo {
{ padding: 5px;
position: absolute; max-width: 100%;
}
h2 {
font-weight: normal;
font-size: 22px;
}
.browser-logo {
display: block;
margin: 30px auto;
height: 120px;
}
.download {
display: block;
}
.bottom {
position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
margin: 1em; margin: 1em;
text-align: center; text-align: center;
color: white;
} }
a .continue {
{ color: white;
color: #444; background-color: #8cc63f;
padding: 5px;
border-radius: 3px;
}
.continue:hover {
text-decoration: none;
background-color: #7eb239;
}
a {
color: #6a1;
border-width: 0; border-width: 0;
text-decoration: none;
}
a:hover {
text-decoration: underline;
} }

View File

@ -2,20 +2,35 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="user-scalable=no"/> <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
<meta name="content-language" content="<?=$lang?>"/> <meta name="content-language" content="<?=$lang?>"/>
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/> <link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/>
<?=css("$dir/style")?> <?=css("$dir/style")?>
<title>Verdnatura</title> <title>Verdnatura</title>
</head> </head>
<body> <body>
<div> <div class="box">
<a href="http://www.mozilla.org/es-ES/firefox/new/" target="_blank"> <img
<img src="<?=$dir?>/update-browser.png" alt="<?=s('UpdateYourBrowser')?>"></img> class="logo"
src="image/logo.png"
alt="VerdNatura">
</img>
<h2><?=s('BrowserVersionNotCompatible')?></h2>
<a
class="download"
href="http://www.mozilla.org/firefox/new/"
target="_blank">
<img
class="browser-logo"
src="<?=$dir?>/firefox.png"
alt="Firefox">
</img>
<?=s('PushHereToInstallFirefox')?>
</a> </a>
</div> </div>
<div id="continue"> <div class="bottom">
<a href="?skipBrowser=true"> <a class="continue"
href="?skipBrowser=true">
<?=s('ContinueAnyway')?> <?=s('ContinueAnyway')?>
</a> </a>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

View File

@ -1,4 +0,0 @@
{
"Recover password": "Recover password",
"Press on the following link to change your password.": "Press on the following link to change your password."
}

View File

@ -0,0 +1,2 @@
recoverPassword: Recover password
pressLinkToRecoverPassword: Press on the following link to change your password.

View File

@ -1,4 +0,0 @@
{
"Recover password": "Restaurar contraseña",
"Press on the following link to change your password.": "Pulsa en el siguiente link para cambiar tu contraseña."
}

View File

@ -0,0 +1,2 @@
recoverPassword: Restaurar contraseña
pressLinkToRecoverPassword: Pulsa en el siguiente link para cambiar tu contraseña.

View File

@ -1,4 +0,0 @@
{
"Recover password": "Réinitialisation du mot de passe",
"Press on the following link to change your password.": "Appuyez sur le lien suivant pour changer votre mot de passe."
}

View File

@ -0,0 +1,2 @@
recoverPassword: Réinitialisation du mot de passe
pressLinkToRecoverPassword: Appuyez sur le lien suivant pour changer votre mot de passe.

View File

@ -1,4 +0,0 @@
{
"Recover password": "Recuperar palavra-passe",
"Press on the following link to change your password.": "Pressione o botão para modificar sua palavra-passe."
}

View File

@ -0,0 +1,2 @@
recoverPassword: Recuperar palavra-passe
pressLinkToRecoverPassword: Pressione o botão para modificar sua palavra-passe.

View File

@ -1,7 +1,7 @@
<?php $title = s('Recover password') ?> <?php $title = s('recoverPassword') ?>
<p> <p>
<?=s('Press on the following link to change your password.')?> <?=s('pressLinkToRecoverPassword')?>
</p> </p>
<a href="<?=$url?>"> <a href="<?=$url?>">
<?=s('Recover password')?> <?=s('recoverPassword')?>
</a> </a>

View File

@ -10,7 +10,7 @@ class Supplant extends Vn\Web\JsonRequest {
'SELECT id FROM account.user WHERE `name` = #', 'SELECT id FROM account.user WHERE `name` = #',
[$_REQUEST['supplantUser']] [$_REQUEST['supplantUser']]
); );
/*
$isClient = $db->getValue( $isClient = $db->getValue(
'SELECT COUNT(*) > 0 FROM vn.client WHERE id = #', 'SELECT COUNT(*) > 0 FROM vn.client WHERE id = #',
[$userId] [$userId]
@ -24,7 +24,7 @@ class Supplant extends Vn\Web\JsonRequest {
); );
if ($hasAccount) if ($hasAccount)
throw new Web\ForbiddenException(s('The user is not impersonable')); throw new Web\ForbiddenException(s('The user is not impersonable'));
*/
return $this->service->createToken($_REQUEST['supplantUser']); return $this->service->createToken($_REQUEST['supplantUser']);
} }
} }

View File

@ -1,5 +0,0 @@
{
"InvalidAction": "Acció invàlida"
,"EmptyQuery": "Consulta buida"
}

2
rest/core/locale/ca.yml Normal file
View File

@ -0,0 +1,2 @@
InvalidAction: Acció invàlida
EmptyQuery: Consulta buida

View File

@ -1,5 +0,0 @@
{
"InvalidAction": "Invalid action"
,"EmptyQuery": "Empty query"
}

2
rest/core/locale/en.yml Normal file
View File

@ -0,0 +1,2 @@
InvalidAction: Invalid action
EmptyQuery: Empty query

View File

@ -1,7 +0,0 @@
{
"InvalidAction": "Acción inválida"
,"EmptyQuery": "Consulta vacía"
,"Invalid password": "Contraseña inválida"
,"Password does not meet requirements":
"La nueva contraseña no reune los requisitos de seguridad necesarios"
}

2
rest/core/locale/es.yml Normal file
View File

@ -0,0 +1,2 @@
InvalidAction: Acción inválida
EmptyQuery: Consulta vacía

View File

@ -1,5 +0,0 @@
{
"InvalidAction": "Action non valide"
,"EmptyQuery": "Requête vide"
}

2
rest/core/locale/fr.yml Normal file
View File

@ -0,0 +1,2 @@
InvalidAction: Action non valide
EmptyQuery: Requête vide

View File

@ -1,5 +0,0 @@
{
"InvalidAction": "Ação Inválida"
,"EmptyQuery": "Consulta vazía"
}

2
rest/core/locale/pt.yml Normal file
View File

@ -0,0 +1,2 @@
InvalidAction: Ação Inválida
EmptyQuery: Consulta vazía

View File

@ -22,53 +22,34 @@ class Query extends Vn\Web\JsonRequest {
function run($db) { function run($db) {
$results = []; $results = [];
$db->multiQuery($_REQUEST['sql']);
try { do {
$db->multiQuery($_REQUEST['sql']); $result = $db->storeResult();
do { if ($result !== FALSE) {
$result = $db->storeResult(); $results[] = $this->transformResult($result);
$result->free();
} else
$results[] = TRUE;
}
while ($db->moreResults() && $db->nextResult());
if ($result !== FALSE) { if ($db->checkWarnings()
$results[] = $this->transformResult($result); &&($result = $db->query('SHOW WARNINGS'))) {
$result->free(); $sql = 'SELECT `description`, @warn `code`
} else FROM `message` WHERE `code` = @warn';
$results[] = TRUE;
while ($row = $result->fetch_object()) {
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);
} }
while ($db->moreResults() && $db->nextResult());
// Checks for warnings
if ($db->checkWarnings()
&&($result = $db->query('SHOW WARNINGS'))) {
$sql = 'SELECT `description`, @warn `code`
FROM `message` WHERE `code` = @warn';
while ($row = $result->fetch_object()) {
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);
}
}
// Checks for errors
$db->checkError();
} catch (Vn\Db\Exception $e) {
if ($e->getCode() == 1644) {
$dbMessage = $e->getMessage();
$sql = 'SELECT `description` FROM `message` WHERE `code` = #';
$message = $db->getValue($sql, [$dbMessage]);
if ($message)
throw new Lib\UserException($message, $dbMessage);
}
throw $e;
} }
$db->checkError();
return $results; return $results;
} }

View File

@ -1,29 +0,0 @@
{
"Cant lock cache": "The cache could not be blocked"
,"Bad file format": "Unrecognized file format"
,"File not choosed": "You have not selected any file"
,"Permission denied": "You are not allowed to upload the file"
,"File upload error": "Failed to upload the file, check that size is not too large"
,"File save error": "Failed to save the file: %s"
,"File size error": "The file must be no longer than %.2f MB"
,"Bad file name": "The file name must contain only lowercase letters, digits or the '_' character"
,"Bad collection name": "Invalid collection name"
,"Collection not exists": "Collection does not exist"
,"Unreferenced file": "The file is not referenced by the database"
,"Cannot update matching id": "Cannot update matching id"
,"Com error": "Error communicating with the server"
,"Image open error": "Error opening the image file"
,"Operation disabled": "Operation disabled for security"
,"Image added": "Image added correctly"
,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
,"ErrPartial": "File was partially uploaded"
,"ErrNoFile": "No file was uploaded"
,"ErrNoTmpDir": "Missing a temporary folder"
,"ErrCantWrite": "Failed to write file to disk"
,"ErrExtension": "File upload stopped by extension"
,"ErrDefault": "Unknown upload error"
,"Sync complete": "Synchronization complete"
}

27
rest/image/locale/en.yml Normal file
View File

@ -0,0 +1,27 @@
Cant lock cache: The cache could not be blocked
Bad file format: Unrecognized file format
File not choosed: You have not selected any file
Permission denied: You are not allowed to upload the file
File upload error: Failed to upload the file, check that size is not too large
File save error: 'Failed to save the file: %s'
File size error: The file must be no longer than %.2f MB
Bad file name: 'The file name must contain only lowercase letters, digits or the ''_'' character'
Bad collection name: Invalid collection name
Collection not exists: Collection does not exist
Unreferenced file: The file is not referenced by the database
Cannot update matching id: Cannot update matching id
Com error: Error communicating with the server
Image open error: Error opening the image file
Operation disabled: Operation disabled for security
Image added: Image added correctly
ErrIniSize: File exceeds the upload_max_filesize directive in php.ini
ErrFormSize: File exceeds the MAX_FILE_SIZE specified in the HTML form
ErrPartial: File was partially uploaded
ErrNoFile: No file was uploaded
ErrNoTmpDir: Missing a temporary folder
ErrCantWrite: Failed to write file to disk
ErrExtension: File upload stopped by extension
ErrDefault: Unknown upload error
Sync complete: Synchronization complete

View File

@ -1,29 +0,0 @@
{
"Cant lock cache": "La caché no pudo ser bloqueada"
,"Bad file format": "Formato de archivo no reconocido"
,"File not choosed": "No has seleccionado ningún archivo"
,"Permission denied": "No tienes permiso para subir el fichero"
,"File upload error": "Error al subir el fichero, comprueba que su tamaño no sea demasiado grande"
,"File save error": "Error al guardar el fichero: %s"
,"File size error": "El fichero no debe ocupar más de %.2f MB"
,"Bad file name": "El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter '_'"
,"Bad collection name": "Nombre de colección no válido"
,"Collection not exists": "La colección no existe"
,"Unreferenced file": "El archivo no está referenciado por la base de datos"
,"Cannot update matching id": "No es posible actualizar los ítems con id coincidente"
,"Com error": "Error en la comunicación con el servidor"
,"Image open error": "Error al abrir el archivo de imagen"
,"Operation disabled": "Operación deshabilitada por seguridad"
,"Image added": "Imagen añadida correctamente"
,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
,"ErrPartial": "File was partially uploaded"
,"ErrNoFile": "No file was uploaded"
,"ErrNoTmpDir": "Missing a temporary folder"
,"ErrCantWrite": "Failed to write file to disk"
,"ErrExtension": "File upload stopped by extension"
,"ErrDefault": "Unknown upload error"
,"Sync complete": "Sincronización completada"
}

27
rest/image/locale/es.yml Normal file
View File

@ -0,0 +1,27 @@
Cant lock cache: La caché no pudo ser bloqueada
Bad file format: Formato de archivo no reconocido
File not choosed: No has seleccionado ningún archivo
Permission denied: No tienes permiso para subir el fichero
File upload error: Error al subir el fichero, comprueba que su tamaño no sea demasiado grande
File save error: 'Error al guardar el fichero: %s'
File size error: El fichero no debe ocupar más de %.2f MB
Bad file name: 'El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter ''_'''
Bad collection name: Nombre de colección no válido
Collection not exists: La colección no existe
Unreferenced file: El archivo no está referenciado por la base de datos
Cannot update matching id: No es posible actualizar los ítems con id coincidente
Com error: Error en la comunicación con el servidor
Image open error: Error al abrir el archivo de imagen
Operation disabled: Operación deshabilitada por seguridad
Image added: Imagen añadida correctamente
ErrIniSize: File exceeds the upload_max_filesize directive in php.ini
ErrFormSize: File exceeds the MAX_FILE_SIZE specified in the HTML form
ErrPartial: File was partially uploaded
ErrNoFile: No file was uploaded
ErrNoTmpDir: Missing a temporary folder
ErrCantWrite: Failed to write file to disk
ErrExtension: File upload stopped by extension
ErrDefault: Unknown upload error
Sync complete: Sincronización completada

View File

@ -1,29 +0,0 @@
{
"Cant lock cache": "O cache não pôde ser bloqueado"
,"Bad file format": "Formato de arquivo inválido"
,"File not choosed": "Não selecionastes nenhum arquivo"
,"Permission denied": "Não estas autorizado a subir o arquivo"
,"File upload error": "Erro ao subir o arquivo, verifique o tamanho"
,"File save error": "Erro ao salvar o arquivo: %s"
,"File size error": "O arquivo não deve ser maior que: %.2f MB"
,"Bad file name": "O nome do arquivo deve conter somente letras minusculas, numeros ou '_' "
,"Bad collection name": "Nome de coleção inválido"
,"Collection not exists": "Coleção não existe"
,"Unreferenced file": "O arquivo não é referenciado pelo banco de dados"
,"Cannot update matching id": "Não é possível atualizar os itens com id coincidente"
,"Com error": "Erro de comunicação com o servidor"
,"Image open error": "Erro ao abrir a imagem"
,"Operation disabled": "Operação desativada por segurança"
,"Image added": "Imagem adicionada corretamente"
,"ErrIniSize": "Arquivo supera o tamanho maximo de protocolo em php.ini"
,"ErrFormSize": "Arquivo supera o tamanho maximo de protocolo em HTML form"
,"ErrPartial": "Arquivo subido parcialmente"
,"ErrNoFile": "Nenhum arquivo subido"
,"ErrNoTmpDir": "Falta a pasta de arquivo temporal"
,"ErrCantWrite": "Erro ao gravar arquivo no disco"
,"ErrExtension": "Erro de extensão do arquivo"
,"ErrDefault": "Erro desconhecido ao subir arquivo"
,"Sync complete": "Sincronização completa"
}

27
rest/image/locale/pt.yml Normal file
View File

@ -0,0 +1,27 @@
Cant lock cache: O cache não pôde ser bloqueado
Bad file format: Formato de arquivo inválido
File not choosed: Não selecionastes nenhum arquivo
Permission denied: Não estas autorizado a subir o arquivo
File upload error: Erro ao subir o arquivo, verifique o tamanho
File save error: 'Erro ao salvar o arquivo: %s'
File size error: O arquivo não deve ser maior que %.2f MB
Bad file name: 'O nome do arquivo deve conter somente letras minusculas, numeros ou ''_'''
Bad collection name: Nome de coleção inválido
Collection not exists: Coleção não existe
Unreferenced file: O arquivo não é referenciado pelo banco de dados
Cannot update matching id: Não é possível atualizar os itens com id coincidente
Com error: Erro de comunicação com o servidor
Image open error: Erro ao abrir a imagem
Operation disabled: Operação desativada por segurança
Image added: Imagem adicionada corretamente
ErrIniSize: Arquivo supera o tamanho maximo de protocolo em php.ini
ErrFormSize: Arquivo supera o tamanho maximo de protocolo em HTML form
ErrPartial: Arquivo subido parcialmente
ErrNoFile: Nenhum arquivo subido
ErrNoTmpDir: Falta a pasta de arquivo temporal
ErrCantWrite: Erro ao gravar arquivo no disco
ErrExtension: Erro de extensão do arquivo
ErrDefault: Erro desconhecido ao subir arquivo
Sync complete: Sincronização completa

View File

@ -1,6 +0,0 @@
{
"An automated message could not be delivered": "Un mensaje automatizado no se ha podido entregar"
,"Notification from IT department about problem.": "Desde el departamento de informática te enviamos este correo porque ha habido un problema al intentar entregar un correo automatizado."
,"If you have questions, resend this email to cau@verdnatura.es.": "Si tienes dudas, reenvia este correo a cau@verdnatura.es."
,"The response from the remote server was:": "La respuesta del servidor remoto ha sido:"
}

4
rest/misc/locale/es.yml Normal file
View File

@ -0,0 +1,4 @@
automatedMessageNotDelivered: Un mensaje automatizado no se ha podido entregar
ITProblemNotification: Desde el departamento de informática te enviamos este correo porque ha habido un problema al intentar entregar un correo automatizado.
ifQuestionsResendEmailToIT: Si tienes dudas, reenvia este correo a cau@verdnatura.es.
'The response from the remote server was:': 'La respuesta del servidor remoto ha sido:'

View File

@ -48,13 +48,13 @@ class Mail extends Vn\Lib\Method {
if ($row->replyTo) { if ($row->replyTo) {
Vn\Lib\Locale::set('es'); Vn\Lib\Locale::set('es');
$errorMsg = $errorMsg =
'<p>'. s('Notification from IT department about problem.') .'</p>' '<p>'. s('ITProblemNotification') .'</p>'
.'<p>'. s('If you have questions, resend this email to cau@verdnatura.es.') .'</p>' .'<p>'. s('ifQuestionsResendEmailToIT') .'</p>'
.'<p style="color: gray">'. $status .'</p>'; .'<p style="color: gray">'. $status .'</p>';
$errorMail = $mailer->createObject($row->replyTo, $errorMail = $mailer->createObject($row->replyTo,
$errorMsg, $errorMsg,
s('An automated message could not be delivered') s('automatedMessageNotDelivered')
); );
$errorMail->AddStringAttachment( $errorMail->AddStringAttachment(
$mail->getSentMIMEMessage(), $mail->getSentMIMEMessage(),

View File

@ -50,9 +50,18 @@ class RestService extends Service {
try { try {
$res = $method->run($methodDb); $res = $method->run($methodDb);
} catch (Db\Exception $e) { } catch (\Vn\Db\Exception $e) {
if ($e->getCode() == 1644) if ($e->getCode() == 1644) {
throw new UserException(s($e->getMessage())); $eMessage = $e->getMessage();
$tMessage = $db->getValue(
'SELECT `description` FROM `message` WHERE `code` = #',
[$eMessage]
);
if (!$tMessage) $tMessage = $eMessage;
throw new Lib\UserException($tMessage, $eMessage);
}
throw $e;
} }
if ($method::SECURITY == Security::DEFINER) if ($method::SECURITY == Security::DEFINER)

View File

@ -3,6 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
<title>Not available - Verdnatura</title> <title>Not available - Verdnatura</title>
<style type="text/css"> <style type="text/css">
body { body {
@ -22,7 +23,7 @@
font-weight: normal; font-weight: normal;
} }
div a { div a {
color: #2962FF; color: #6a1;
text-decoration: none; text-decoration: none;
} }
</style> </style>