Skip to content

Commit

Permalink
Updated translations and minor fixes on the Dashboard template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos García Gómez committed Sep 22, 2021
1 parent c1ff4ff commit 6bbf815
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Core/Base/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class PluginManager
/**
* FacturaScripts core version.
*/
const CORE_VERSION = 2021.40;
const CORE_VERSION = 2021.41;

/**
* Path to list plugins on file.
Expand Down
22 changes: 16 additions & 6 deletions Core/Controller/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function privateCore(&$response, $user, $permissions)
private function getStatsMonth(int $previous): string
{
$mask = '-' . $previous . ' month';
return date('F', strtotime($mask));
return strtolower(date('F', strtotime($mask)));
}

/**
Expand Down Expand Up @@ -213,8 +213,12 @@ private function loadOpenLinks()
$this->setOpenLinksForDocument(new PedidoCliente(), 'order');
$this->setOpenLinksForDocument(new PresupuestoCliente(), 'estimation');

$minDate = date(Producto::DATE_STYLE, strtotime('-2 days'));
$minDateTime = date(Producto::DATETIME_STYLE, strtotime('-2 days'));

$customerModel = new Cliente();
foreach ($customerModel->all([], ['fechaalta' => 'DESC'], 0, 3) as $customer) {
$whereCustomer = [new DataBaseWhere('fechaalta', $minDate, '>=')];
foreach ($customerModel->all($whereCustomer, ['fechaalta' => 'DESC'], 0, 3) as $customer) {
$this->openLinks[] = [
'type' => 'customer',
'url' => $customer->url(),
Expand All @@ -224,7 +228,8 @@ private function loadOpenLinks()
}

$contactModel = new Contacto();
foreach ($contactModel->all([], ['fechaalta' => 'DESC'], 0, 3) as $contact) {
$whereContact = [new DataBaseWhere('fechaalta', $minDate, '>=')];
foreach ($contactModel->all($whereContact, ['fechaalta' => 'DESC'], 0, 3) as $contact) {
$this->openLinks[] = [
'type' => 'contact',
'url' => $contact->url(),
Expand All @@ -234,12 +239,13 @@ private function loadOpenLinks()
}

$productModel = new Producto();
foreach ($productModel->all([], ['actualizado' => 'DESC'], 0, 3) as $product) {
$whereProd = [new DataBaseWhere('actualizado', $minDateTime, '>=')];
foreach ($productModel->all($whereProd, ['actualizado' => 'DESC'], 0, 3) as $product) {
$this->openLinks[] = [
'type' => 'product',
'url' => $product->url(),
'name' => $product->referencia,
'date' => $product->fechaalta
'date' => $product->actualizado
];
}

Expand Down Expand Up @@ -310,7 +316,11 @@ private function loadStats()
*/
private function setOpenLinksForDocument($model, $label)
{
$where = [new DataBaseWhere('nick', $this->user->nick)];
$minDate = date(BusinessDocument::DATE_STYLE, strtotime('-2 days'));
$where = [
new DataBaseWhere('fecha', $minDate, '>='),
new DataBaseWhere('nick', $this->user->nick)
];
foreach ($model->all($where, [$model->primaryColumn() => 'DESC'], 0, 3) as $doc) {
$this->openLinks[] = [
'type' => $label,
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/ca_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atribut 4",
"attribute-values": "Valors d'atribut",
"attributes": "Atributs",
"august": "Agosto",
"authentication": "Autenticació",
"auto": "Auto",
"auto-apply-to": "aplicar automàticament a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diari de tancament",
"journal-opening": "Diari d'obertura",
"journals": "Diaris",
"july": "Julio",
"keys": "Claus",
"lang-code": "Codi d'idioma",
"language": "Llenguatge",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "S'ha produït un error en enviar el correu electrònic",
"send-mail-ok": "Correu enviat",
"sepa-suffix": "Sufix SEPA",
"september": "Septiembre",
"sequences": "Seqüències",
"serial-number": "Nombre de Sèrie",
"serie": "Sèrie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "attribute-value-4",
"attribute-values": "Attribute values",
"attributes": "Attribute",
"august": "Agosto",
"authentication": "authentication",
"auto": "Auto",
"auto-apply-to": "auto-apply-to",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "journal-closing",
"journal-opening": "journal-opening",
"journals": "Journals",
"july": "Julio",
"keys": "keys",
"lang-code": "Sprachcode",
"language": "Sprache:",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "send-mail-error",
"send-mail-ok": "send-mail-ok",
"sepa-suffix": "sepa-suffix",
"september": "Septiembre",
"sequences": "sequences",
"serial-number": "Serial Number",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Attribute 4",
"attribute-values": "Attribute values",
"attributes": "Attributes",
"august": "Agosto",
"authentication": "Authentication",
"auto": "Auto",
"auto-apply-to": "Automatically apply to",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Journal for closing",
"journal-opening": "Journal for opening",
"journals": "Journals",
"july": "Julio",
"keys": "keys",
"lang-code": "Language code",
"language": "Language",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error when sending the email",
"send-mail-ok": "Email sent correctly",
"sepa-suffix": "SEPA suffix",
"september": "Septiembre",
"sequences": "Sequences",
"serial-number": "Serial Number",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_AR.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_CL.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_CO.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el correo",
"send-mail-ok": "Correo enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_CR.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_DO.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_EC.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el correo",
"send-mail-ok": "Correo enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_GT.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el email",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "send-mail-error",
"send-mail-ok": "Email enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de Serie",
"serie": "Serie",
Expand Down
3 changes: 3 additions & 0 deletions Core/Translation/es_PE.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"attribute-value-4": "Atributo 4",
"attribute-values": "Valores de atributo",
"attributes": "Atributos",
"august": "Agosto",
"authentication": "Autenticación",
"auto": "Auto",
"auto-apply-to": "Aplicar automáticamente a",
Expand Down Expand Up @@ -621,6 +622,7 @@
"journal-closing": "Diario de cierre",
"journal-opening": "Diario de apertura",
"journals": "Diarios",
"july": "Julio",
"keys": "Claves",
"lang-code": "Código de idioma",
"language": "Idioma",
Expand Down Expand Up @@ -1000,6 +1002,7 @@
"send-mail-error": "Error al enviar el correo",
"send-mail-ok": "Correo enviado correctamente",
"sepa-suffix": "Sufijo SEPA",
"september": "Septiembre",
"sequences": "Secuencias",
"serial-number": "Número de serie",
"serie": "Serie",
Expand Down
Loading

0 comments on commit 6bbf815

Please sign in to comment.