4774-translationsVn #3138

Open
carlossa wants to merge 21 commits from 4774-translationsVn into dev
13 changed files with 435 additions and 2 deletions

View File

@ -219,5 +219,26 @@
}, },
"MrwService": { "MrwService": {
"dataSource": "vn" "dataSource": "vn"
},
"CompanyI18n": {
"dataSource": "vn"
},
"ItemTypeI18n": {
"dataSource": "vn"
},
"InkI18n": {
"dataSource": "vn"
},
"OriginI18n": {
"dataSource": "vn"
},
"StateI18n": {
"dataSource": "vn"
},
"TagI18n": {
"dataSource": "vn"
},
"ItemCategoryI18n": {
"dataSource": "vn"
} }
} }

View File

@ -0,0 +1,26 @@
{
"name": "CompanyI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "companyI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"companyFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"footnotes": {
"type": "string"
}
}
}

26
back/models/inkI18n.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "InkI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "inkI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"inkFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
}
}
}

View File

@ -0,0 +1,26 @@
{
"name": "ItemCategoryI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "itemCategoryI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"categoryFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
}
}
}

View File

@ -0,0 +1,27 @@
{
"name": "ItemTypeI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "itemTypeI18n"
}
},
"properties": {
"typeFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
},
"id": {
"type": "number",
"id": true
}
}
}

View File

@ -0,0 +1,26 @@
{
"name": "OriginI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "originI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"originFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
}
}
}

View File

@ -0,0 +1,26 @@
{
"name": "StateI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "stateI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"stateFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
}
}
}

26
back/models/tagI18n.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "TagI18n",
"base": "VnModel",
"options": {
"mysql": {
"table": "tagI18n"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"tagFk": {
"type": "number",
"id": 1
},
"lang": {
"type": "string",
"id": 2
},
"name": {
"type": "string"
}
}
}

View File

@ -4047,6 +4047,149 @@ INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
(8, '1183'), (8, '1183'),
carlossa marked this conversation as resolved Outdated
Outdated
Review

(Y esta)

(Y esta)
(1, '1320'); (1, '1320');
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, 1169),
(8, 1183),
(NULL, 1320);
INSERT IGNORE INTO vn.saySimpleConfig (url)
VALUES ('saysimle-url-mock');
INSERT INTO vn.itemTypeI18n (typeFk, lang, name)
VALUES
(1, 'ca', 'Alstroemeria'),
(1, 'en', 'Alstroemeria'),
(1, 'fr', 'Alstroemeria'),
(1, 'pt', 'Alstroemeria'),
(2, 'ca', 'Anthurium'),
(2, 'en', 'Anthurium'),
(2, 'fr', 'Anthurium'),
(2, 'pt', 'Antúrios'),
(3, 'ca', 'Bulbs'),
(3, 'en', 'Bulbs'),
(3, 'fr', 'Bulbes'),
(3, 'pt', 'Bulbos'),
(4, 'ca', 'Cales'),
(4, 'en', 'Calla Lilies'),
(4, 'fr', 'Calas'),
(4, 'pt', 'Jarros (callas)'),
(5, 'ca', 'Clavell'),
(5, 'en', 'Carnation'),
(5, 'fr', 'Oeillet'),
(5, 'pt', 'Cravo'),
(6, 'ca', 'Crisantem'),
(6, 'en', 'Chrysanthemum'),
(6, 'fr', 'Chrysanthème'),
(6, 'pt', 'Margaridas'),
(7, 'ca', 'Rams Variats'),
(7, 'en', 'Mixed Bouquets'),
(7, 'fr', 'Bouquets divers'),
(7, 'pt', 'Bouquet Variados'),
(8, 'ca', 'Flor Variada'),
(8, 'en', 'Assorted Flowers'),
(8, 'fr', 'Fleurs varié'),
(8, 'pt', 'Flores Variadas'),
(9, 'ca', 'Crisantem Santa Dorotea'),
(9, 'en', 'Santa Dorotea Chrysanthemum'),
(9, 'fr', 'Chrysanthème Santa Dorotea'),
(9, 'pt', 'Crisântemo Santa Dorotea');
INSERT INTO vn.inkI18n (inkFk, lang, name)
VALUES
('?', 'ca', 'Sense especificar'),
('?', 'en', 'Unspecified'),
('?', 'fr', 'Indéterminé'),
('?', 'mn', 'тодорхойгүй'),
('?', 'pt', 'Não especificado'),
('2C', 'ca', '2 Colors'),
('2C', 'en', '2 Colour'),
('2C', 'fr', '2 Couleur'),
('2C', 'mn', '2 Өнгө'),
('2C', 'pt', '2 Cor'),
('A/M', 'ca', 'Groc / Marró'),
('A/M', 'en', 'Yellow / Brown'),
('A/M', 'fr', 'Yellow / Brown'),
('A/M', 'mn', 'Шар / Браун'),
('A/M', 'pt', 'Yellow / Brown'),
('A/N', 'ca', 'Groc / Taronja'),
('A/N', 'en', 'Yellow orange'),
('A/N', 'fr', 'Jaune / Orange'),
('A/N', 'mn', 'Шар / Улбар шар'),
('A/N', 'pt', 'Amarelo / Laranja');
INSERT INTO vn.itemCategoryI18n (categoryFk, lang, name)
VALUES
(1, 'ca', 'Flor'),
(1, 'en', 'Flower'),
(1, 'fr', 'Fleur'),
(1, 'mn', 'цэцэг'),
(1, 'pt', 'Flores'),
(2, 'ca', 'Planta'),
(2, 'en', 'Plant'),
(2, 'fr', 'Plante'),
(2, 'mn', 'станц'),
(2, 'pt', 'Plantas'),
(3, 'ca', 'Complements'),
(3, 'en', 'Accessories'),
(3, 'fr', 'Accessoires'),
(3, 'mn', 'Дагалдах хэрэгсэл'),
(3, 'pt', 'Acessórios'),
(4, 'ca', 'Artificial'),
(4, 'en', 'Artificial'),
(4, 'fr', 'Artificielle'),
(4, 'mn', 'Хиймэл'),
(4, 'pt', 'Artificial'),
(5, 'ca', 'Verds'),
(5, 'en', 'Green'),
(5, 'fr', 'Vert'),
(5, 'mn', 'ногоон'),
(5, 'pt', 'Verdes');
INSERT INTO vn.originI18n (originFk, lang, name)
VALUES
(1, 'ca', 'Chollolandia'),
(1, 'en', 'Chollolandia'),
(1, 'fr', 'Chollolandia'),
(1, 'mn', 'Chollolandia'),
(1, 'pt', 'Chollolandia'),
(2, 'ca', 'Alemanya'),
(2, 'en', 'Germany'),
(2, 'fr', 'Allemagne'),
(2, 'mn', 'Герман'),
(2, 'pt', 'Alemanha'),
(3, 'ca', 'Almeria'),
(3, 'en', 'Almeria'),
(3, 'fr', 'Almeria'),
(3, 'mn', 'Зугаа'),
(3, 'pt', 'Almeria'),
(4, 'ca', 'Austràlia'),
(4, 'en', 'Australia'),
(4, 'fr', 'Australie'),
(4, 'mn', 'Австрали'),
(4, 'pt', 'Austrália'),
(5, 'ca', 'canada'),
(5, 'en', 'Canada'),
(5, 'fr', 'Canada'),
(5, 'mn', 'Канад'),
(5, 'pt', 'Canadá');
INSERT INTO vn.stateI18n (stateFk, lang, name)
VALUES
(1, 'en', 'Fix'),
(1, 'es', 'Arreglar'),
(2, 'en', 'Free'),
(2, 'es', 'Libre'),
(3, 'en', 'OK'),
(3, 'es', 'OK'),
(4, 'en', 'Printed'),
(4, 'es', 'Impreso'),
(5, 'en', 'Preparation'),
(5, 'es', 'Preparación'),
(6, 'en', 'In Review'),
(6, 'es', 'En Revisión'),
(7, 'en', 'Unfinished'),
(7, 'es', 'Sin Acabar');
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
VALUES ('saysimle-url-mock', '1819'); VALUES ('saysimle-url-mock', '1819');

View File

@ -0,0 +1,46 @@
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
carlossa marked this conversation as resolved
Review

Preguntar quins rols deuen poder fer WRITE, employee sgurament no dega

Preguntar quins rols deuen poder fer WRITE, employee sgurament no dega
VALUES
('CompanyI18n','find','READ','ALLOW','ROLE','administrative'),
('CompanyI18n','crud','WRITE','ALLOW','ROLE','administrative'),
('CompanyI18n','create','WRITE','ALLOW','ROLE','administrative'),
('ItemTypeI18n','find','READ','ALLOW','ROLE','buyer'),
('ItemTypeI18n','crud','WRITE','ALLOW','ROLE','buyer'),
('ItemTypeI18n','create','WRITE','ALLOW','ROLE','buyer'),
('InkI18n','find','READ','ALLOW','ROLE','buyer'),
('InkI18n','crud','WRITE','ALLOW','ROLE','buyer'),
('InkI18n','create','WRITE','ALLOW','ROLE','buyer'),
('OriginI18n','find','READ','ALLOW','ROLE','buyer'),
('OriginI18n','crud','WRITE','ALLOW','ROLE','buyer'),
('OriginI18n','create','WRITE','ALLOW','ROLE','buyer'),
('StateI18n','find','READ','ALLOW','ROLE','salesPerson'),
('StateI18n','crud','WRITE','ALLOW','ROLE','salesPerson'),
('StateI18n','create','WRITE','ALLOW','ROLE','salesPerson'),
('TagI18n','find','READ','ALLOW','ROLE','buyer'),
('TagI18n','crud','WRITE','ALLOW','ROLE','buyer'),
('TagI18n','create','WRITE','ALLOW','ROLE','buyer'),
('itemCategoryI18n','find','READ','ALLOW','ROLE','buyer'),
('itemCategoryI18n','crud','WRITE','ALLOW','ROLE','buyer'),
('itemCategoryI18n','create','WRITE','ALLOW','ROLE','buyer'),
('Application','getI18nTables','*','ALLOW','ROLE','employee');
carlossa marked this conversation as resolved
Review

Igual que esta igual no deu tot el mon

Igual que esta igual no deu tot el mon
ALTER TABLE vn.companyI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.inkI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.itemCategoryI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.itemTypeI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.originI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.stateI18n
ADD id INT AUTO_INCREMENT UNIQUE;
ALTER TABLE vn.tagI18n
ADD id INT AUTO_INCREMENT UNIQUE;

View File

@ -0,0 +1,39 @@
module.exports = Self => {
Self.remoteMethod('getI18nTables', {
description: 'Return tables with name end with i18n',
accessType: 'READ',
accepts: [],
returns: {
type: 'Array',
root: true
},
http: {
path: `/get-i18n-tables`,
verb: 'GET'
}
});
Self.getI18nTables = async() => {
const tables = await Self.rawSql(`
SELECT c.table_name tableName, c.column_name primaryKey
FROM information_schema.columns c
WHERE
c.table_name LIKE '%i18n'
AND c.COLUMN_KEY = 'PRI'
AND c.column_name <> 'id'
AND c.COLUMN_NAME <> 'lang'`);
const columns = await Self.rawSql(`
SELECT c.table_name tableName, c.column_name field
FROM information_schema.columns c
WHERE
c.table_name LIKE '%i18n'
AND c.COLUMN_KEY <> 'PRI'
AND c.column_name <> 'id'
`);
for (const column of columns)
tables.find(t => t.tableName == column.tableName).field = column.field;
return tables;
};
};

View File

@ -5,4 +5,5 @@ module.exports = function(Self) {
require('../methods/application/executeProc')(Self); require('../methods/application/executeProc')(Self);
require('../methods/application/executeFunc')(Self); require('../methods/application/executeFunc')(Self);
require('../methods/application/getEnumValues')(Self); require('../methods/application/getEnumValues')(Self);
require('../methods/application/getI18nTables')(Self);
}; };

View File

@ -43,7 +43,7 @@ class Controller extends Section {
}}; }};
this.$http.get('DmsTypes/findOne', {params}).then(res => { this.$http.get('DmsTypes/findOne', {params}).then(res => {
const dmsTypeId = res.data && res.data.id; const dmsTypeId = res.data && res.data.id;
const warehouseId = this.vnConfig.warehouseFk; const warehouseId = this.ticket.warehouseFk;
carlossa marked this conversation as resolved
Review

Se ha colat?

Se ha colat?
const defaultParams = { const defaultParams = {
reference: this.ticket.id, reference: this.ticket.id,
warehouseId: warehouseId, warehouseId: warehouseId,