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 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
php-apcu \
php-image-text \
php-text-captcha \
php-apcu \
php-zip \
hedera-web \
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.

2
debian/control vendored
View File

@ -10,7 +10,7 @@ Vcs-Git: https://gitea.verdnatura.es/verdnatura/hedera-web
Package: hedera-web
Architecture: all
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
Priority: optional
Description: Verdnatura's web page

View File

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

View File

@ -106,25 +106,23 @@ export default new Class({
Vn.Node.addClass(this.$[id], 'selected');
},
disableButtons(disable) {
this.$.modify.disabled = disable;
this.$.confirm.disabled = disable;
},
onModifyClick() {
window.history.back();
},
async onConfirmClick() {
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) {
this.disableButtons(false);
if (resultSet.fetchResult())
this.$.successDialog.show();
disableButtons(disable) {
this.$.modify.disabled = disable;
this.$.confirm.disabled = disable;
},
async onDialogResponse() {

View File

@ -23,9 +23,6 @@
tmp.orderTax;
</db-model>
</db-form>
<db-query id="confirm-query" on-ready="onConfirm">
CALL myBasket_confirm
</db-query>
</vn-group>
<div id="title">
<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'));
else {
switch (err.exception) {
case 'UserDisabled':
case 'OutdatedVersion':
case 'UserDisabledError':
case 'OutdatedVersionError':
return;
}
if (err.statusCode == 401)

View File

@ -50,19 +50,16 @@ module.exports = new Class({
this.doc.body.appendChild(this.node);
Htk.Toast.pushTop(this.$.formHolder);
await this.refreshUserData();
Vn.Node.setText(this.$.userName, this.user.nickname);
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 dbproduccion FROM vn.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
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() {
if (!this._shown)
return;
@ -474,11 +477,8 @@ module.exports = new Class({
this._conn.token = json;
sessionStorage.setItem('supplantUser', supplantUser);
const resultSet = await this._conn.execQuery(
'SELECT nickname FROM account.myUser');
const userName = resultSet.fetchValue();
Vn.Node.setText(this.$.supplanted, userName);
await this.refreshUserData();
Vn.Node.setText(this.$.supplanted, this.user.nickname);
this.$.supplant.classList.toggle('show', true);
await this.loadMenu();
}
@ -492,6 +492,7 @@ module.exports = new Class({
sessionStorage.removeItem('supplantUser');
this.$.supplant.classList.toggle('show', false);
await this.refreshUserData();
await this.loadMenu();
this._onFormChange();
}

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -1,2 +1,4 @@
UpdateYourBrowser: Actualitza el teu navegador
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
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
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
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
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';
}
img
{
position: absolute;
margin-top: -200px;
margin-left: -200px;
top: 50%;
left: 50%;
.box {
text-align: center;
margin: 0 auto;
max-width: 380px;
padding: 40px;
padding-bottom: 60px;
}
#continue
{
position: absolute;
.logo {
padding: 5px;
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;
left: 0;
right: 0;
margin: 1em;
text-align: center;
color: white;
}
a
{
color: #444;
.continue {
color: white;
background-color: #8cc63f;
padding: 5px;
border-radius: 3px;
}
.continue:hover {
text-decoration: none;
background-color: #7eb239;
}
a {
color: #6a1;
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">
<head>
<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?>"/>
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"/>
<?=css("$dir/style")?>
<title>Verdnatura</title>
</head>
<body>
<div>
<a href="http://www.mozilla.org/es-ES/firefox/new/" target="_blank">
<img src="<?=$dir?>/update-browser.png" alt="<?=s('UpdateYourBrowser')?>"></img>
<div class="box">
<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>
</div>
<div id="continue">
<a href="?skipBrowser=true">
<div class="bottom">
<a class="continue"
href="?skipBrowser=true">
<?=s('ContinueAnyway')?>
</a>
</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>
<?=s('Press on the following link to change your password.')?>
<?=s('pressLinkToRecoverPassword')?>
</p>
<a href="<?=$url?>">
<?=s('Recover password')?>
<?=s('recoverPassword')?>
</a>

View File

@ -10,7 +10,7 @@ class Supplant extends Vn\Web\JsonRequest {
'SELECT id FROM account.user WHERE `name` = #',
[$_REQUEST['supplantUser']]
);
/*
$isClient = $db->getValue(
'SELECT COUNT(*) > 0 FROM vn.client WHERE id = #',
[$userId]
@ -24,7 +24,7 @@ class Supplant extends Vn\Web\JsonRequest {
);
if ($hasAccount)
throw new Web\ForbiddenException(s('The user is not impersonable'));
*/
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,8 +22,6 @@ class Query extends Vn\Web\JsonRequest {
function run($db) {
$results = [];
try {
$db->multiQuery($_REQUEST['sql']);
do {
@ -37,8 +35,6 @@ class Query extends Vn\Web\JsonRequest {
}
while ($db->moreResults() && $db->nextResult());
// Checks for warnings
if ($db->checkWarnings()
&&($result = $db->query('SHOW WARNINGS'))) {
$sql = 'SELECT `description`, @warn `code`
@ -53,22 +49,7 @@ class Query extends Vn\Web\JsonRequest {
}
}
// 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;
}
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) {
Vn\Lib\Locale::set('es');
$errorMsg =
'<p>'. s('Notification from IT department about problem.') .'</p>'
.'<p>'. s('If you have questions, resend this email to cau@verdnatura.es.') .'</p>'
'<p>'. s('ITProblemNotification') .'</p>'
.'<p>'. s('ifQuestionsResendEmailToIT') .'</p>'
.'<p style="color: gray">'. $status .'</p>';
$errorMail = $mailer->createObject($row->replyTo,
$errorMsg,
s('An automated message could not be delivered')
s('automatedMessageNotDelivered')
);
$errorMail->AddStringAttachment(
$mail->getSentMIMEMessage(),

View File

@ -50,9 +50,18 @@ class RestService extends Service {
try {
$res = $method->run($methodDb);
} catch (Db\Exception $e) {
if ($e->getCode() == 1644)
throw new UserException(s($e->getMessage()));
} catch (\Vn\Db\Exception $e) {
if ($e->getCode() == 1644) {
$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)

View File

@ -3,6 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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>
<style type="text/css">
body {
@ -22,7 +23,7 @@
font-weight: normal;
}
div a {
color: #2962FF;
color: #6a1;
text-decoration: none;
}
</style>