Compare commits
338 Commits
Author | SHA1 | Date |
---|---|---|
|
16cc55da0c | |
|
8a3acff50b | |
|
a3f5283c49 | |
|
2584abd224 | |
|
3f1a93a47a | |
|
48c3d7cbe3 | |
|
e4223a3aee | |
|
38dd1d6303 | |
|
215142c6b7 | |
|
30dca813b6 | |
|
3630a72b78 | |
|
9b1765e9bf | |
|
85296109ca | |
|
be8a1121f8 | |
|
b94368f7c9 | |
|
5b15351844 | |
|
3eb191d2d1 | |
|
2392f8c8d7 | |
|
e618090c7c | |
|
242ea99e61 | |
|
ecfb6cc4eb | |
|
ad9be84b9c | |
|
9658a63b6b | |
|
4c1514f2a7 | |
|
fb7da8a878 | |
|
f2a13b7b96 | |
|
d6f1c8dc04 | |
|
c32231202f | |
|
4a7bc00c62 | |
|
aacac8dc28 | |
|
6adb4268ff | |
|
9b26f2dc7f | |
|
bf25e871f3 | |
|
3aad2eaeec | |
|
0f1bde3b77 | |
|
99c1386627 | |
|
d913eba277 | |
|
dedb8a73a5 | |
|
09866f5b41 | |
|
41196b4a23 | |
|
65923fee9f | |
|
52e45b93a0 | |
|
221d0e7b8c | |
|
e7289b05e9 | |
|
9fb67992ae | |
|
be0636a832 | |
|
0aeacc88bc | |
|
e4770c045d | |
|
9cff4a9ea6 | |
|
f52ee3f649 | |
|
3c3e88b044 | |
|
c61b047fed | |
|
b80d6e499a | |
|
0661f4dd74 | |
|
f8da4a09bb | |
|
456522e1dd | |
|
11e1404b93 | |
|
0806f63d8d | |
|
af7db23fed | |
|
3ddf73c958 | |
|
26320f098f | |
|
7d0d52c704 | |
|
63b43506ab | |
|
16b1e205d3 | |
|
7c2f6183b0 | |
|
8fd4448aab | |
|
2507b7c7e2 | |
|
fe2b1e3e79 | |
|
77bc288682 | |
|
cc06eaa203 | |
|
cf17529b80 | |
|
151ec4bcbb | |
|
33bc413e8c | |
|
e7aebc371e | |
|
fed067c533 | |
|
f1f40527bc | |
|
65280ccbc9 | |
|
5b84a03e16 | |
|
850f4ba804 | |
|
b05aaa36ba | |
|
bc97cd4a0a | |
|
56a4d46ac8 | |
|
b47b63a550 | |
|
0280a1ae82 | |
|
fdda9a56c4 | |
|
d6a8fa03dc | |
|
65b9d3d139 | |
|
ba0883fc7a | |
|
18e9f7cbe1 | |
|
2bf1c1f6dc | |
|
a8d5f06866 | |
|
cfceee4838 | |
|
6c9e3bbc55 | |
|
a285e1acc7 | |
|
bf6690113d | |
|
3c18f64d58 | |
|
aec14f8ebd | |
|
e1be2703e8 | |
|
46b828bd0c | |
|
dfc8096b19 | |
|
1dc5bfe90c | |
|
8fc5c8e3e4 | |
|
3219d44bdb | |
|
833e464a99 | |
|
650fa0006f | |
|
94a105ab31 | |
|
56262d91b4 | |
|
247ad94199 | |
|
e554dd1cb1 | |
|
5a0dc0a927 | |
|
8863b6428c | |
|
f27dd79dcc | |
|
bb28805d23 | |
|
484e41e86b | |
|
0fc1fc58e6 | |
|
69abcf6870 | |
|
dff5820ed4 | |
|
ab7c1d1fe0 | |
|
f70b98b514 | |
|
22153c5171 | |
|
12ff0b5845 | |
|
1471d323d6 | |
|
879e3cbb44 | |
|
a142ceb151 | |
|
e4bc14ef3b | |
|
40444ac46a | |
|
5f0a2f9181 | |
|
eea2ad7984 | |
|
0bec75b2d3 | |
|
186ec60937 | |
|
cb1542937a | |
|
cfff9f7aeb | |
|
ff423ae79b | |
|
693b309e79 | |
|
62349278ed | |
|
9450be744a | |
|
bbaa6f936e | |
|
8021a171f8 | |
|
2d9225f05f | |
|
cd7a4b13f6 | |
|
4c041f42b2 | |
|
c9812cd320 | |
|
b669adab5a | |
|
1cbbc092be | |
|
56cf0f0e64 | |
|
0b70344708 | |
|
ec9d2bce56 | |
|
851d97f321 | |
|
c72bfdc100 | |
|
57e1f66a94 | |
|
ef3b41e4e2 | |
|
a97219ad59 | |
|
0246e39f0f | |
|
e5efdff1d8 | |
|
15c5dc761f | |
|
514af4f11e | |
|
72da0cb5a1 | |
|
baa1422025 | |
|
261fddb1cf | |
|
c950bf5ef1 | |
|
fdff59a74d | |
|
68f32c36e7 | |
|
3e93f14196 | |
|
5cab14f371 | |
|
49244a411c | |
|
2eb0963829 | |
|
477c42b964 | |
|
baaff90aef | |
|
4111dd8669 | |
|
ce7e04379a | |
|
6927b86570 | |
|
577a6281b8 | |
|
4358ef70c0 | |
|
d8ec175328 | |
|
0f5014088d | |
|
202c22b8a9 | |
|
58b7325605 | |
|
e6f0320cf5 | |
|
fac528b42f | |
|
101ac917a2 | |
|
0529505cc2 | |
|
622ce6ae28 | |
|
8664f40e06 | |
|
e39cab82f6 | |
|
72cd9e6cd6 | |
|
ff0d2db8fe | |
|
bbaa6d87ff | |
|
c3e3b4d7b6 | |
|
d824df5eb0 | |
|
f4fea5e904 | |
|
d09f90d47c | |
|
bc97e000b8 | |
|
cdf534e70b | |
|
f8e67f0d98 | |
|
2b41bc31c1 | |
|
cc44041e31 | |
|
85eee7bb7a | |
|
2a43ab023a | |
|
be868b60ab | |
|
f56d4cca14 | |
|
67847e798b | |
|
79ddbe4916 | |
|
8ffe9a6a96 | |
|
21b6e96148 | |
|
f1a8fd2710 | |
|
59e8285bd2 | |
|
2176c6e259 | |
|
533c7560dc | |
|
c4a64bff91 | |
|
3c71c71df1 | |
|
e76e4e4f8c | |
|
f95a8c9daa | |
|
2758dcf2c8 | |
|
facb565d26 | |
|
a7edc9b87a | |
|
93e739f35c | |
|
65e0d752d6 | |
|
418911b903 | |
|
decf955224 | |
|
d736ea716b | |
|
a9427ddab9 | |
|
057bfae517 | |
|
929623949b | |
|
38a88bb0cc | |
|
265ff5c47f | |
|
c41d1430f7 | |
|
2bff9304e8 | |
|
c53658e6e0 | |
|
e94f8c6b23 | |
|
c52fe7a870 | |
|
bfbe3621d6 | |
|
05568280f3 | |
|
6bfa5b9715 | |
|
6631be401b | |
|
ba2ded5c48 | |
|
723a977ecd | |
|
a1d67ebc6f | |
|
7026e3416f | |
|
975495113d | |
|
8e0f09cc0f | |
|
95e23c05fa | |
|
6423ecfb05 | |
|
3a21292030 | |
|
f2bd3c2fa6 | |
|
020e0afc96 | |
|
766417bb73 | |
|
c77c2e6648 | |
|
6fe518601f | |
|
cb2c9871cc | |
|
a832a1889a | |
|
7c4123ca0b | |
|
facbe9b990 | |
|
57880705d0 | |
|
ed29a1939c | |
|
5456db8add | |
|
053b9f8457 | |
|
8866331926 | |
|
33ef1da2a9 | |
|
2e2c83dcde | |
|
73eb3dcbee | |
|
05d735702e | |
|
462a8a3cf8 | |
|
f821b8689a | |
|
e47edb9827 | |
|
25f4f822b4 | |
|
ef35914f34 | |
|
b19bf710e8 | |
|
17a519e2ee | |
|
95a2bfb69c | |
|
6e41548fdf | |
|
c86c1cc0c0 | |
|
87c151c057 | |
|
13af1d03a3 | |
|
14bef2383f | |
|
5053a908f7 | |
|
7e0c591026 | |
|
594b17b4ab | |
|
887ee8aea4 | |
|
44627dbc8a | |
|
f2c8b90324 | |
|
e0f55f8ca3 | |
|
f36eb1bd88 | |
|
b728ecaf29 | |
|
7c96106faa | |
|
a0fc1cfc07 | |
|
b66c47955c | |
|
ec14ca334a | |
|
7837925be9 | |
|
2fb892c71a | |
|
2a1cd59492 | |
|
76b99ed293 | |
|
67c6f84de3 | |
|
745e9a569c | |
|
ad2d494481 | |
|
24687e57e6 | |
|
c20f48b2bf | |
|
6bad41db20 | |
|
eb0328753a | |
|
e067f5f7bd | |
|
34a0d93ece | |
|
4256f45373 | |
|
93cc0d4286 | |
|
ef36566442 | |
|
06cd9b01d3 | |
|
7f831ae3a5 | |
|
382378e867 | |
|
401487dfd3 | |
|
aa4ccf65f5 | |
|
fb267b910b | |
|
24a9c130d1 | |
|
f59b37c722 | |
|
160552ff2f | |
|
83e3e034a8 | |
|
61062c1418 | |
|
2cbbaf619c | |
|
ec0d783672 | |
|
07c5f64265 | |
|
dcbc154caa | |
|
0d3da684b4 | |
|
8d2f041c46 | |
|
28b2dd386f | |
|
d589b89a62 | |
|
04660bd05e | |
|
1d6ec00c78 | |
|
ce557dc5b9 | |
|
4387a868bc | |
|
003f42dd03 | |
|
9dfeb2f7ef | |
|
8bea750244 | |
|
bf2094163d | |
|
e0cc4e40ba | |
|
47c6fe02ec | |
|
6458d8db5e | |
|
0234e14c6b | |
|
7e26aa773c | |
|
0d0be4ee5f | |
|
042b8b0309 | |
|
b7658b76cf |
|
@ -0,0 +1,9 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
|
@ -0,0 +1,8 @@
|
||||||
|
/dist
|
||||||
|
/src-bex/www
|
||||||
|
/src-capacitor
|
||||||
|
/src-cordova
|
||||||
|
/.quasar
|
||||||
|
/node_modules
|
||||||
|
.eslintrc.js
|
||||||
|
babel.config.js
|
|
@ -0,0 +1,86 @@
|
||||||
|
module.exports = {
|
||||||
|
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
||||||
|
// This option interrupts the configuration hierarchy at this file
|
||||||
|
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
||||||
|
root: true,
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
parser: '@babel/eslint-parser',
|
||||||
|
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
||||||
|
sourceType: 'module' // Allows for the use of imports
|
||||||
|
},
|
||||||
|
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
'vue/setup-compiler-macros': true
|
||||||
|
},
|
||||||
|
|
||||||
|
extends: ['standard'],
|
||||||
|
plugins: ['vue', 'prettier'],
|
||||||
|
globals: {
|
||||||
|
ga: 'readonly', // Google Analytics
|
||||||
|
cordova: 'readonly',
|
||||||
|
__statics: 'readonly',
|
||||||
|
__QUASAR_SSR__: 'readonly',
|
||||||
|
__QUASAR_SSR_SERVER__: 'readonly',
|
||||||
|
__QUASAR_SSR_CLIENT__: 'readonly',
|
||||||
|
__QUASAR_SSR_PWA__: 'readonly',
|
||||||
|
process: 'readonly',
|
||||||
|
Capacitor: 'readonly',
|
||||||
|
chrome: 'readonly'
|
||||||
|
},
|
||||||
|
|
||||||
|
// add your custom rules here
|
||||||
|
rules: {
|
||||||
|
// allow async-await
|
||||||
|
'generator-star-spacing': 'off',
|
||||||
|
// allow paren-less arrow functions
|
||||||
|
'arrow-parens': 'off',
|
||||||
|
'one-var': 'off',
|
||||||
|
'no-void': 'off',
|
||||||
|
'multiline-ternary': 'off',
|
||||||
|
|
||||||
|
'import/first': 'off',
|
||||||
|
'import/named': 'error',
|
||||||
|
'import/namespace': 'error',
|
||||||
|
'import/default': 'error',
|
||||||
|
'import/export': 'error',
|
||||||
|
'import/extensions': 'off',
|
||||||
|
'import/no-unresolved': 'off',
|
||||||
|
'import/no-extraneous-dependencies': 'off',
|
||||||
|
|
||||||
|
'prefer-promise-reject-errors': 'off',
|
||||||
|
semi: 'off',
|
||||||
|
// allow debugger during development only
|
||||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['src/**/*.{js,vue,scss}', 'quasar.config.js'], // Aplica ESLint solo a archivos .js, .vue y .scss dentro de src (Proyecto de quasar)
|
||||||
|
extends: [
|
||||||
|
// Base ESLint recommended rules
|
||||||
|
'eslint:recommended',
|
||||||
|
// Uncomment any of the lines below to choose desired strictness,
|
||||||
|
// but leave only one uncommented!
|
||||||
|
// See https://eslint.vuejs.org/rules/#available-rules
|
||||||
|
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
|
||||||
|
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
|
||||||
|
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
|
||||||
|
// https://github.com/prettier/eslint-config-prettier#installation
|
||||||
|
// usage with Prettier, provided by 'eslint-config-prettier'.
|
||||||
|
'prettier',
|
||||||
|
'plugin:cypress/recommended'
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
semi: 'off',
|
||||||
|
'space-before-function-paren': 'off',
|
||||||
|
'prefer-promise-reject-errors': 'off',
|
||||||
|
'vue/no-multiple-template-root': 'off'
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: '2021'
|
||||||
|
},
|
||||||
|
plugins: ['vue']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
|
@ -1,15 +0,0 @@
|
||||||
extends: eslint:recommended
|
|
||||||
parserOptions:
|
|
||||||
ecmaVersion: 2017
|
|
||||||
sourceType: module
|
|
||||||
rules:
|
|
||||||
no-undef: 0
|
|
||||||
no-redeclare: 0
|
|
||||||
no-mixed-spaces-and-tabs: 0
|
|
||||||
no-console: 0
|
|
||||||
no-cond-assign: 0
|
|
||||||
no-unexpected-multiline: 0
|
|
||||||
brace-style: [error, 1tbs]
|
|
||||||
space-before-function-paren: [error, never]
|
|
||||||
padded-blocks: [error, never]
|
|
||||||
func-call-spacing: [error, never]
|
|
|
@ -1,6 +1,36 @@
|
||||||
node_modules
|
|
||||||
build/
|
build/
|
||||||
dist/
|
|
||||||
config.my.php
|
config.my.php
|
||||||
.vscode/
|
|
||||||
|
.DS_Store
|
||||||
|
.thumbs.db
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Quasar core related directories
|
||||||
.quasar
|
.quasar
|
||||||
|
/dist
|
||||||
|
|
||||||
|
# Cordova related directories and files
|
||||||
|
/src-cordova/node_modules
|
||||||
|
/src-cordova/platforms
|
||||||
|
/src-cordova/plugins
|
||||||
|
/src-cordova/www
|
||||||
|
|
||||||
|
# Capacitor related directories and files
|
||||||
|
/src-capacitor/www
|
||||||
|
/src-capacitor/node_modules
|
||||||
|
|
||||||
|
# BEX related directories and files
|
||||||
|
/src-bex/www
|
||||||
|
/src-bex/js/core
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* eslint-disable */
|
||||||
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
// to edit target browsers: use "browserslist" field in package.json
|
||||||
|
require('autoprefixer')
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
module.exports = {
|
||||||
|
printWidth: 80,
|
||||||
|
tabWidth: 4,
|
||||||
|
useTabs: false,
|
||||||
|
singleQuote: true,
|
||||||
|
bracketSpacing: true,
|
||||||
|
arrowParens: 'avoid',
|
||||||
|
trailingComma: 'none'
|
||||||
|
};
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"vue.volar",
|
||||||
|
"wayou.vscode-todo-highlight"
|
||||||
|
],
|
||||||
|
"unwantedRecommendations": [
|
||||||
|
"octref.vetur",
|
||||||
|
"hookyqr.beautify",
|
||||||
|
"dbaeumer.jshint",
|
||||||
|
"ms-vscode.vscode-typescript-tslint-plugin"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Listen for XDebug",
|
||||||
|
"type": "php",
|
||||||
|
"request": "launch",
|
||||||
|
"port": 9000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Launch currently open script",
|
||||||
|
"type": "php",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${file}",
|
||||||
|
"cwd": "${fileDirname}",
|
||||||
|
"port": 9000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"editor.bracketPairColorization.enabled": true,
|
||||||
|
"editor.guides.bracketPairs": true,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
|
||||||
|
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
|
||||||
|
"cSpell.words": ["axios", "composables"]
|
||||||
|
}
|
|
@ -28,7 +28,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | tee /etc/apt/trusted.gpg.d/verdnatura.gpg \
|
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
|
||||||
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
||||||
> /etc/apt/sources.list.d/vn.list \
|
> /etc/apt/sources.list.d/vn.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
|
def PROTECTED_BRANCH
|
||||||
|
def RUN_BUILD
|
||||||
|
|
||||||
def BRANCH_ENV = [
|
def BRANCH_ENV = [
|
||||||
test: 'test',
|
test: 'test',
|
||||||
master: 'production'
|
master: 'production',
|
||||||
|
beta: 'test'
|
||||||
]
|
]
|
||||||
def remote = [:]
|
def remote = [:]
|
||||||
|
|
||||||
|
@ -10,6 +14,15 @@ node {
|
||||||
stage('Setup') {
|
stage('Setup') {
|
||||||
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||||
|
|
||||||
|
PROTECTED_BRANCH = [
|
||||||
|
'dev',
|
||||||
|
'test',
|
||||||
|
'master',
|
||||||
|
'beta'
|
||||||
|
].contains(env.BRANCH_NAME)
|
||||||
|
|
||||||
|
RUN_BUILD = PROTECTED_BRANCH
|
||||||
|
|
||||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
}
|
}
|
||||||
|
@ -22,14 +35,11 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Debuild') {
|
stage('Debuild') {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
expression { PROTECTED_BRANCH }
|
||||||
branch 'master'
|
|
||||||
branch 'test'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn7'
|
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn8'
|
||||||
registryUrl 'https://registry.verdnatura.es/'
|
registryUrl 'https://registry.verdnatura.es/'
|
||||||
registryCredentialsId 'docker-registry'
|
registryCredentialsId 'docker-registry'
|
||||||
}
|
}
|
||||||
|
@ -55,10 +65,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
expression { PROTECTED_BRANCH }
|
||||||
branch 'master'
|
|
||||||
branch 'test'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
CREDS = credentials('docker-registry')
|
CREDS = credentials('docker-registry')
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (C) 2016 - Juan Ferrer Toribio
|
Copyright (C) 2024 - Verdnatura Levante SL
|
||||||
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
This package is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
51
README.md
51
README.md
|
@ -1,58 +1,35 @@
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
Hedera is the main web shop page for Verdnatura.
|
Hedera is the main web page for Verdnatura.
|
||||||
|
|
||||||
## Prerequisites
|
## Getting Started
|
||||||
|
|
||||||
Required applications.
|
Required dependencies.
|
||||||
* PHP >= 8.4
|
|
||||||
* Node.js >= 20.0
|
|
||||||
|
|
||||||
Take a look to *debian/control* file to see additional dependencies.
|
- PHP >= 7.0
|
||||||
|
- Node.js >= 18.0
|
||||||
|
|
||||||
Copy config.php to *config.my.php* and place your DB config there.
|
Launch application for development.
|
||||||
|
|
||||||
### Installing dependencies and launching
|
|
||||||
|
|
||||||
Pull from repository.
|
|
||||||
|
|
||||||
Run this commands on project root directory to install Node dependencies.
|
|
||||||
```
|
```
|
||||||
$ npm install
|
$ quasar dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Install project dependences (debian/control).
|
Launch Salix backend.
|
||||||
|
|
||||||
Pull from repository [php-vn-lib](https://gitea.verdnatura.es/verdnatura/php-vn-lib) and install [dependences](https://gitea.verdnatura.es/verdnatura/php-vn-lib/src/branch/master/debian/control) of this project.
|
|
||||||
|
|
||||||
Configure config.php file.
|
|
||||||
|
|
||||||
Launch project fronted.
|
|
||||||
```
|
|
||||||
$ npm run front
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Launch salix backend.
|
pnpm run back
|
||||||
```
|
```
|
||||||
$ npm run db
|
|
||||||
$ npm run back
|
|
||||||
```
|
|
||||||
Launch project backend.
|
|
||||||
```
|
|
||||||
$ php -S 127.0.0.1:3001 -t . index.php
|
|
||||||
```
|
|
||||||
|
|
||||||
### Command line
|
|
||||||
|
|
||||||
Run server side method from command line.
|
Run server side method from command line.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ php hedera-web.php -m method_path
|
php hedera-web.php -m method_path
|
||||||
```
|
```
|
||||||
|
|
||||||
## Built with
|
## Built with
|
||||||
|
|
||||||
* [nodejs](https://nodejs.org/)
|
- [Webpack](https://webpack.js.org/)
|
||||||
* [php](https://www.php.net/)
|
- [MooTools](https://mootools.net/)
|
||||||
* [Webpack](https://webpack.js.org/)
|
- [TinyMCE](https://www.tinymce.com/)
|
||||||
* [MooTools](https://mootools.net/)
|
|
||||||
* [TinyMCE](https://www.tinymce.com/)
|
|
||||||
|
|
41
app.js
41
app.js
|
@ -1,41 +0,0 @@
|
||||||
__webpack_public_path__ = _PUBLIC_PATH;
|
|
||||||
|
|
||||||
import 'promise-polyfill/src/polyfill';
|
|
||||||
import 'hedera/hedera';
|
|
||||||
const locales = require('./import').locales;
|
|
||||||
const packageJson = require('./package.json');
|
|
||||||
|
|
||||||
window.onload = function() {
|
|
||||||
loadLocale(main);
|
|
||||||
}
|
|
||||||
|
|
||||||
function main() {
|
|
||||||
Vn.setVersion(packageJson.version);
|
|
||||||
const hederaWeb = new Hedera.App();
|
|
||||||
window.hederaWeb = hederaWeb;
|
|
||||||
hederaWeb.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadLocale(callback) {
|
|
||||||
Vn.Locale.init();
|
|
||||||
var lang = Vn.Locale.language;
|
|
||||||
|
|
||||||
var req = require.context('js', true, /locale\/en.yml$/);
|
|
||||||
onLocaleLoad(Vn.Locale.fallbackLang, req);
|
|
||||||
|
|
||||||
const loadFn = locales[lang];
|
|
||||||
if (loadFn)
|
|
||||||
loadFn(function(req) {
|
|
||||||
onLocaleLoad(lang, req);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
else
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onLocaleLoad(lang, req) {
|
|
||||||
var keys = req.keys();
|
|
||||||
|
|
||||||
for (var i = 0; i < keys.length; i++)
|
|
||||||
Vn.Locale.add(req(keys[i]), lang);
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
module.exports = api => {
|
||||||
|
return {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@quasar/babel-preset-app',
|
||||||
|
api.caller(caller => caller && caller.target === 'node')
|
||||||
|
? { targets: { node: 'current' } }
|
||||||
|
: {}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,14 +9,26 @@
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
DocumentRoot /usr/share/hedera-web/
|
DocumentRoot /usr/share/hedera-web/spa
|
||||||
|
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{QUERY_STRING} (^|&)srv=([^&]+) [OR]
|
||||||
|
RewriteCond %{REQUEST_METHOD} POST
|
||||||
|
RewriteRule ^/$ /usr/share/hedera-web/back/index.php [L]
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
<Directory /usr/share/hedera-web/>
|
<Directory /usr/share/hedera-web/back>
|
||||||
Options -Indexes -FollowSymLinks
|
Options -Indexes -FollowSymLinks
|
||||||
AllowOverride None
|
AllowOverride None
|
||||||
Require all granted
|
Require all granted
|
||||||
|
|
||||||
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
|
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
<Directory /usr/share/hedera-web/spa>
|
||||||
|
Options -FollowSymLinks
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
|
||||||
<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
|
<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
|
||||||
SetOutputFilter DEFLATE
|
SetOutputFilter DEFLATE
|
|
@ -12,8 +12,6 @@
|
||||||
*
|
*
|
||||||
* - http://www.mydomain.org -> config.www.php
|
* - http://www.mydomain.org -> config.www.php
|
||||||
* - http://test.mydomain.org -> config.test.php
|
* - http://test.mydomain.org -> config.test.php
|
||||||
*
|
|
||||||
* Put the password in base64.
|
|
||||||
*/
|
*/
|
||||||
return [
|
return [
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +22,7 @@ return [
|
||||||
,'port' => 3306
|
,'port' => 3306
|
||||||
,'schema' => 'hedera'
|
,'schema' => 'hedera'
|
||||||
,'user' => 'hedera-web'
|
,'user' => 'hedera-web'
|
||||||
,'pass' => '' // base64 encoded
|
,'pass' => ''
|
||||||
,'tz' => 'Europe/madrid'
|
,'tz' => 'Europe/madrid'
|
||||||
]
|
]
|
||||||
];
|
];
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__.'/../php-vn-lib/env.php';
|
require_once __DIR__.'/../../php-vn-lib/env.php';
|
||||||
|
|
||||||
set_include_path(__DIR__.PATH_SEPARATOR.get_include_path());
|
set_include_path(__DIR__.PATH_SEPARATOR.get_include_path());
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"name": "hedera-web-back",
|
||||||
|
"version": "24.50.16",
|
||||||
|
"description": "Verdnatura web page backend",
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"author": "Verdnatura Levante SL"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"InvalidAction": "Acció invàlida"
|
||||||
|
|
||||||
|
,"EmptyQuery": "Consulta buida"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"InvalidAction": "Invalid action"
|
||||||
|
|
||||||
|
,"EmptyQuery": "Empty query"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"InvalidAction": "Action non valide"
|
||||||
|
|
||||||
|
,"EmptyQuery": "Requête vide"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"InvalidAction": "Ação Inválida"
|
||||||
|
|
||||||
|
,"EmptyQuery": "Consulta vazía"
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Vn\Lib;
|
use Vn\Lib;
|
||||||
use Vn\Lib\Locale;
|
|
||||||
use Vn\Web\Security;
|
use Vn\Web\Security;
|
||||||
use Vn\Lib\Type;
|
use Vn\Lib\Type;
|
||||||
|
|
||||||
|
@ -23,38 +22,53 @@ class Query extends Vn\Web\JsonRequest {
|
||||||
|
|
||||||
function run($db) {
|
function run($db) {
|
||||||
$results = [];
|
$results = [];
|
||||||
$db->multiQuery($_REQUEST['sql']);
|
|
||||||
|
|
||||||
do {
|
try {
|
||||||
$result = $db->storeResult();
|
$db->multiQuery($_REQUEST['sql']);
|
||||||
|
|
||||||
if ($result !== FALSE) {
|
do {
|
||||||
$results[] = $this->transformResult($result);
|
$result = $db->storeResult();
|
||||||
$result->free();
|
|
||||||
} else
|
|
||||||
$results[] = TRUE;
|
|
||||||
}
|
|
||||||
while ($db->moreResults() && $db->nextResult());
|
|
||||||
|
|
||||||
if ($db->checkWarnings()
|
if ($result !== FALSE) {
|
||||||
&& ($result = $db->query('SHOW WARNINGS'))) {
|
$results[] = $this->transformResult($result);
|
||||||
$sql =
|
$result->free();
|
||||||
'SELECT IFNULL(i.`description`, m.`description`) `description`, @warn `code`
|
} else
|
||||||
FROM `message` m
|
$results[] = TRUE;
|
||||||
LEFT JOIN `messageI18n` i
|
|
||||||
ON i.`code` = m.`code` AND i.lang = #
|
|
||||||
WHERE m.`code` = @warn';
|
|
||||||
|
|
||||||
while ($row = $result->fetch_object()) {
|
|
||||||
if ($row->Code == 1265
|
|
||||||
&& ($warning = $db->getObject($sql, [Locale::get()])))
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Vn\Web\Security;
|
||||||
|
use Vn\Web\Util;
|
||||||
|
use Vn\Lib;
|
||||||
|
|
||||||
|
class Invoice extends Vn\Web\RestRequest {
|
||||||
|
const PARAMS = ['invoice'];
|
||||||
|
const SECURITY = Security::INVOKER;
|
||||||
|
|
||||||
|
function run($db) {
|
||||||
|
$pdfPath = $db->getValueFromFile(__DIR__ .'/invoice',
|
||||||
|
['invoice' =>(int) $_GET['invoice']]);
|
||||||
|
|
||||||
|
if (!$pdfPath)
|
||||||
|
throw new Lib\UserException(s('Invoice id not found'));
|
||||||
|
|
||||||
|
Util::printFile($pdfPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
SELECT CONCAT_WS('/', c.pdfsDir, vn.invoiceOut_getPath(#invoice))
|
||||||
|
FROM config c
|
||||||
|
JOIN myInvoice i
|
||||||
|
WHERE i.id = #invoice
|
|
@ -8,7 +8,7 @@ class Clean extends Edi\Method {
|
||||||
|
|
||||||
$cleanPeriod = $db->getValue(
|
$cleanPeriod = $db->getValue(
|
||||||
"SELECT ic.cleanPeriod
|
"SELECT ic.cleanPeriod
|
||||||
FROM imapMultiConfig ic
|
FROM imapConfig ic
|
||||||
JOIN util.config c ON c.environment = ic.environment");
|
JOIN util.config c ON c.environment = ic.environment");
|
||||||
|
|
||||||
$deleted = 0;
|
$deleted = 0;
|
|
@ -14,7 +14,7 @@ abstract class Method extends \Vn\Lib\Method {
|
||||||
|
|
||||||
$imapConf = $db->getRow(
|
$imapConf = $db->getRow(
|
||||||
"SELECT ic.host, ic.user, ic.pass, ic.successFolder, ic.errorFolder
|
"SELECT ic.host, ic.user, ic.pass, ic.successFolder, ic.errorFolder
|
||||||
FROM imapMultiConfig ic
|
FROM imapConfig ic
|
||||||
JOIN util.config c ON c.environment = ic.environment");
|
JOIN util.config c ON c.environment = ic.environment");
|
||||||
|
|
||||||
$this->mailbox = sprintf('{%s/imap/ssl/novalidate-cert}',
|
$this->mailbox = sprintf('{%s/imap/ssl/novalidate-cert}',
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
|
@ -39,31 +39,31 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
|
|
||||||
if ($_FILES['image']['error'] != 0) {
|
if ($_FILES['image']['error'] != 0) {
|
||||||
switch ($_FILES['image']['error']) {
|
switch ($_FILES['image']['error']) {
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
$message = 'ErrIniSize';
|
$message = 'ErrIniSize';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
$message = 'ErrFormSize';
|
$message = 'ErrFormSize';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_PARTIAL:
|
case UPLOAD_ERR_PARTIAL:
|
||||||
$message = 'ErrPartial';
|
$message = 'ErrPartial';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_FILE:
|
case UPLOAD_ERR_NO_FILE:
|
||||||
$message = 'ErrNoFile';
|
$message = 'ErrNoFile';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_TMP_DIR:
|
case UPLOAD_ERR_NO_TMP_DIR:
|
||||||
$message = 'ErrNoTmpDir';
|
$message = 'ErrNoTmpDir';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_CANT_WRITE:
|
case UPLOAD_ERR_CANT_WRITE:
|
||||||
$message = 'ErrCantWrite';
|
$message = 'ErrCantWrite';
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_EXTENSION:
|
case UPLOAD_ERR_EXTENSION:
|
||||||
$message = 'ErrExtension';
|
$message = 'ErrExtension';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$message = 'ErrDefault';
|
$message = 'ErrDefault';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Lib\Exception(s($message));
|
throw new Lib\Exception(s($message));
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,12 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
$symbolicSrc = "../full/$fileName";
|
$symbolicSrc = "../full/$fileName";
|
||||||
|
|
||||||
$image = Image::create($tmpName);
|
$image = Image::create($tmpName);
|
||||||
|
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
||||||
|
|
||||||
|
foreach ($info['sizes'] as $size => $i) {
|
||||||
|
$dstFile = "$collectionPath/$size/$fileName";
|
||||||
|
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
||||||
|
}
|
||||||
|
|
||||||
$query =
|
$query =
|
||||||
"INSERT INTO `image`
|
"INSERT INTO `image`
|
||||||
|
@ -115,13 +121,6 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
'name' => $name
|
'name' => $name
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
|
||||||
|
|
||||||
foreach ($info['sizes'] as $size => $i) {
|
|
||||||
$dstFile = "$collectionPath/$size/$fileName";
|
|
||||||
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
unlink($tmpName);
|
unlink($tmpName);
|
||||||
return TRUE;
|
return TRUE;
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ejemplo:
|
||||||
|
* <Cube><Cube time="2010-12-10"><Cube currency="USD" rate="1.3244"/>
|
||||||
|
*/
|
||||||
|
class ExchangeRate extends Vn\Lib\Method {
|
||||||
|
function run($db) {
|
||||||
|
$db->selectDb('vn2008');
|
||||||
|
|
||||||
|
// Indica la URL del archivo
|
||||||
|
|
||||||
|
$xml = new SimpleXMLElement(
|
||||||
|
'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', 0, TRUE);
|
||||||
|
|
||||||
|
$date = $db->getValue("SELECT MAX(date) fecha FROM reference_rate");
|
||||||
|
$maxDate = $date ? DateTime::createFromFormat('Y-m-d', $date) : NULL;
|
||||||
|
|
||||||
|
foreach ($xml->Cube[0]->Cube as $cube) {
|
||||||
|
$xmlDate = new DateTime($cube['time']);
|
||||||
|
|
||||||
|
// Si existen datos más recientes de la máxima fecha los añade
|
||||||
|
|
||||||
|
if ($maxDate <= $xmlDate)
|
||||||
|
foreach ($cube->Cube as $subCube)
|
||||||
|
if ($subCube['currency'] == 'USD') {
|
||||||
|
$params = [
|
||||||
|
'date' => $xmlDate,
|
||||||
|
'rate' => $subCube['rate']
|
||||||
|
];
|
||||||
|
$db->query(
|
||||||
|
'REPLACE INTO reference_rate(moneda_id, date, rate)
|
||||||
|
VALUES(2, #date, #rate)',
|
||||||
|
$params
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->queryFromFile(__DIR__.'/exrate-add');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
INSERT INTO reference_rate (moneda_id, date, rate)
|
||||||
|
SELECT 2, TIMESTAMPADD (DAY, 1, r1.date), r1.rate
|
||||||
|
FROM reference_rate r1
|
||||||
|
LEFT JOIN reference_rate r2
|
||||||
|
ON TIMESTAMPADD(DAY, 1, r1.date) = r2.date
|
||||||
|
WHERE r2.date IS NULL AND r1.date < TIMESTAMPADD (DAY, -2, CURDATE())
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"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:"
|
||||||
|
}
|
|
@ -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('ITProblemNotification') .'</p>'
|
'<p>'. s('Notification from IT department about problem.') .'</p>'
|
||||||
.'<p>'. s('ifQuestionsResendEmailToIT') .'</p>'
|
.'<p>'. s('If you have questions, resend this email to cau@verdnatura.es.') .'</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('automatedMessageNotDelivered')
|
s('An automated message could not be delivered')
|
||||||
);
|
);
|
||||||
$errorMail->AddStringAttachment(
|
$errorMail->AddStringAttachment(
|
||||||
$mail->getSentMIMEMessage(),
|
$mail->getSentMIMEMessage(),
|
|
@ -48,13 +48,13 @@ class JsonService extends RestService {
|
||||||
|
|
||||||
$json = new JsonException();
|
$json = new JsonException();
|
||||||
|
|
||||||
if (_ENABLE_DEBUG || $errno & $eUser) {
|
if (_ENABLE_DEBUG || $errno & $eUser)
|
||||||
$json->message = $message;
|
$json->message = $message;
|
||||||
$json->code = $errno;
|
else
|
||||||
} else
|
|
||||||
$json->message = s('Something went wrong');
|
$json->message = s('Something went wrong');
|
||||||
|
|
||||||
if (_ENABLE_DEBUG) {
|
if (_ENABLE_DEBUG) {
|
||||||
|
$json->code = $errno;
|
||||||
$json->file = $file;
|
$json->file = $file;
|
||||||
$json->line = $line;
|
$json->line = $line;
|
||||||
}
|
}
|
||||||
|
@ -79,13 +79,13 @@ class JsonService extends RestService {
|
||||||
if (_ENABLE_DEBUG || $e instanceof Lib\UserException) {
|
if (_ENABLE_DEBUG || $e instanceof Lib\UserException) {
|
||||||
$json->exception = get_class($e);
|
$json->exception = get_class($e);
|
||||||
$json->message = $e->getMessage();
|
$json->message = $e->getMessage();
|
||||||
$json->code = $e->getCode();
|
|
||||||
} else {
|
} else {
|
||||||
$json->exception = 'Exception';
|
$json->exception = 'Exception';
|
||||||
$json->message = s('Something went wrong');
|
$json->message = s('Something went wrong');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ENABLE_DEBUG) {
|
if (_ENABLE_DEBUG) {
|
||||||
|
$json->code = $e->getCode();
|
||||||
$json->file = $e->getFile();
|
$json->file = $e->getFile();
|
||||||
$json->line = $e->getLine();
|
$json->line = $e->getLine();
|
||||||
$json->trace = $e->getTrace();
|
$json->trace = $e->getTrace();
|
|
@ -5,7 +5,6 @@ namespace Vn\Web;
|
||||||
require_once 'libphp-phpmailer/autoload.php';
|
require_once 'libphp-phpmailer/autoload.php';
|
||||||
|
|
||||||
use Vn\Lib\UserException;
|
use Vn\Lib\UserException;
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
|
||||||
|
|
||||||
class Mailer {
|
class Mailer {
|
||||||
private $conf;
|
private $conf;
|
||||||
|
@ -20,7 +19,7 @@ class Mailer {
|
||||||
function createObject($mailTo, $body, $subject) {
|
function createObject($mailTo, $body, $subject) {
|
||||||
$conf = $this->conf;
|
$conf = $this->conf;
|
||||||
|
|
||||||
$mail = new PHPMailer();
|
$mail = new \PHPMailer();
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
$mail->Host = $conf->host;
|
$mail->Host = $conf->host;
|
||||||
|
|
|
@ -50,22 +50,9 @@ class RestService extends Service {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$res = $method->run($methodDb);
|
$res = $method->run($methodDb);
|
||||||
} catch (\Vn\Db\Exception $e) {
|
} catch (Db\Exception $e) {
|
||||||
if ($e->getCode() == 1644) {
|
if ($e->getCode() == 1644)
|
||||||
$eMessage = $e->getMessage();
|
throw new UserException(s($e->getMessage()));
|
||||||
$tMessage = $db->getValue(
|
|
||||||
'SELECT IFNULL(i.`description`, m.`description`) `description`
|
|
||||||
FROM `message` m
|
|
||||||
LEFT JOIN `messageI18n` i
|
|
||||||
ON i.`code` = m.`code` AND i.lang = #
|
|
||||||
WHERE m.`code` = #',
|
|
||||||
[Locale::get(), $eMessage]
|
|
||||||
);
|
|
||||||
if (!$tMessage) $tMessage = $eMessage;
|
|
||||||
throw new Lib\UserException($tMessage, $eMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($method::SECURITY == Security::DEFINER)
|
if ($method::SECURITY == Security::DEFINER)
|
|
@ -158,10 +158,8 @@ abstract class Service {
|
||||||
[$token]
|
[$token]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$userId) {
|
if (!$userId)
|
||||||
$_SESSION['user'] = null;
|
|
||||||
throw new SessionExpiredException();
|
throw new SessionExpiredException();
|
||||||
}
|
|
||||||
|
|
||||||
$anonymousUser = FALSE;
|
$anonymousUser = FALSE;
|
||||||
$user = $db->getValue(
|
$user = $db->getValue(
|
||||||
|
@ -177,10 +175,8 @@ abstract class Service {
|
||||||
[$user]
|
[$user]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$isActive) {
|
if (!$isActive)
|
||||||
$_SESSION['user'] = null;
|
|
||||||
throw new UserDisabledException();
|
throw new UserDisabledException();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query('CALL account.myUser_loginWithName(#)', [$user]);
|
$db->query('CALL account.myUser_loginWithName(#)', [$user]);
|
||||||
|
@ -191,6 +187,7 @@ abstract class Service {
|
||||||
$_SESSION['user'] = $user;
|
$_SESSION['user'] = $user;
|
||||||
|
|
||||||
// Registering the user access
|
// Registering the user access
|
||||||
|
|
||||||
if (isset($_SESSION['access']) && $userChanged)
|
if (isset($_SESSION['access']) && $userChanged)
|
||||||
$db->query(
|
$db->query(
|
||||||
'CALL visitUser_new(#, #)',
|
'CALL visitUser_new(#, #)',
|
|
@ -3,7 +3,6 @@
|
||||||
<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 {
|
||||||
|
@ -23,7 +22,7 @@
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
div a {
|
div a {
|
||||||
color: #6a1;
|
color: #2962FF;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -0,0 +1,32 @@
|
||||||
|
const { defineConfig } = require('cypress');
|
||||||
|
|
||||||
|
module.exports = defineConfig({
|
||||||
|
e2e: {
|
||||||
|
baseUrl: 'http://localhost:8080/',
|
||||||
|
supportFile: 'src/test/cypress/support/index.js',
|
||||||
|
fixturesFolder: 'src/test/cypress/fixtures',
|
||||||
|
specPattern: 'src/test/cypress/integration/**/*.spec.js',
|
||||||
|
viewportHeight: 660,
|
||||||
|
viewportWidth: 1240,
|
||||||
|
experimentalMemoryManagement: true,
|
||||||
|
numTestsKeptInMemory: 0,
|
||||||
|
video: false,
|
||||||
|
screenshotOnRunFailure: false,
|
||||||
|
reporter: 'cypress-mochawesome-reporter',
|
||||||
|
reporterOptions: {
|
||||||
|
charts: true,
|
||||||
|
reportPageTitle: 'Hedera-Web E2E Reporter',
|
||||||
|
embeddedScreenshots: true,
|
||||||
|
reportDir: 'src/test/cypress/reports',
|
||||||
|
inlineAssets: true
|
||||||
|
},
|
||||||
|
setupNodeEvents (on, config) {
|
||||||
|
require('cypress-mochawesome-reporter/plugin')(on);
|
||||||
|
on('after:spec', (spec, results) => {
|
||||||
|
console.log('Finished running', spec.relative);
|
||||||
|
console.log('❌spec:', results.stats.failures);
|
||||||
|
console.log('✅spec:', results.stats.passes);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (25.4.4) stable; urgency=low
|
hedera-web (24.50.16) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -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-image-text, php-text-captcha, php-zip, cron
|
Suggests: php-text-captcha, php-zip, cron
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Description: Verdnatura's web page
|
Description: Verdnatura's web page
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
MAILTO=webmaster
|
MAILTO=webmaster
|
||||||
*/1 * * * * root hedera-web.php -m misc/mail
|
*/1 * * * * root hedera-web.php -m misc/mail
|
||||||
|
*/4 * * * * root hedera-web.php -m tpv/confirm-mail
|
||||||
*/2 * * * * root hedera-web.php -m edi/load
|
*/2 * * * * root hedera-web.php -m edi/load
|
||||||
0 23 * * * root hedera-web.php -m edi/clean
|
0 23 * * * root hedera-web.php -m edi/clean
|
||||||
0 5 * * * root hedera-web.php -m edi/update
|
0 5 * * * root hedera-web.php -m edi/update
|
||||||
|
0 5 * * * root hedera-web.php -m misc/exchange-rate
|
||||||
0 0 * * * root hedera-web.php -m image/sync
|
0 0 * * * root hedera-web.php -m image/sync
|
||||||
0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null
|
0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null
|
||||||
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null
|
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
apache.conf etc/hedera-web
|
back/apache.conf etc/hedera-web
|
||||||
config.php etc/hedera-web
|
back/config.php etc/hedera-web
|
||||||
php.ini etc/hedera-web
|
back/php.ini etc/hedera-web
|
||||||
web usr/share/php/vn
|
back/web usr/share/php/vn
|
||||||
doc/* usr/share/doc/hedera-web
|
back/index.php usr/share/hedera-web/back
|
||||||
hedera-web.php usr/share/hedera-web
|
back/hedera-web.php usr/share/hedera-web/back
|
||||||
forms usr/share/hedera-web
|
back/rest usr/share/hedera-web/back
|
||||||
image usr/share/hedera-web
|
back/package.json usr/share/hedera-web/back
|
||||||
js usr/share/hedera-web
|
dist/spa/* usr/share/hedera-web/spa
|
||||||
pages usr/share/hedera-web
|
build-deps/node_modules usr/share/hedera-web/spa
|
||||||
reports usr/share/hedera-web
|
back/utils usr/share/hedera-web
|
||||||
rest usr/share/hedera-web
|
|
||||||
utils usr/share/hedera-web
|
|
||||||
index.php usr/share/hedera-web
|
|
||||||
package.json usr/share/hedera-web
|
|
||||||
build usr/share/hedera-web
|
|
||||||
README.md usr/share/hedera-web
|
README.md usr/share/hedera-web
|
||||||
webpack.config.json usr/share/hedera-web
|
|
||||||
build-deps/node_modules usr/share/hedera-web
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
usr/share/hedera-web/hedera-web.php usr/bin/hedera-web.php
|
usr/share/hedera-web/back/hedera-web.php usr/bin/hedera-web.php
|
||||||
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf
|
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf
|
||||||
etc/hedera-web/php.ini etc/php/8.2/apache2/conf.d/99-hedera-web.ini
|
etc/hedera-web/php.ini etc/php/7.0/apache2/conf.d/99-hedera-web.ini
|
||||||
|
|
|
@ -10,9 +10,9 @@ clean:
|
||||||
dh_clean $@
|
dh_clean $@
|
||||||
|
|
||||||
build:
|
build:
|
||||||
npm install --no-audit --prefer-offline
|
pnpm install --prefer-offline
|
||||||
npm --omit=dev run build
|
pnpm exec quasar build
|
||||||
|
|
||||||
mkdir -p build-deps
|
mkdir -p build-deps
|
||||||
cp package.json package-lock.json build-deps
|
cp package.json build-deps
|
||||||
(cd build-deps && npm install --omit=dev --no-audit --prefer-offline)
|
(cd build-deps && npm install --omit=dev --no-audit --prefer-offline)
|
||||||
|
|
BIN
doc/Htk.odg
BIN
doc/Htk.odg
Binary file not shown.
|
@ -1,43 +0,0 @@
|
||||||
import './style.scss';
|
|
||||||
|
|
||||||
export default new Class({
|
|
||||||
Extends: Hedera.Form,
|
|
||||||
Template: require('./ui.xml')
|
|
||||||
|
|
||||||
,activate() {
|
|
||||||
this.$.userModel.setInfo('c', 'myClient', 'hedera');
|
|
||||||
this.$.addresses.setInfo('a', 'myAddress', 'hedera');
|
|
||||||
}
|
|
||||||
|
|
||||||
,onAddAddressClick() {
|
|
||||||
this.hash.setAll({
|
|
||||||
form: 'account/address',
|
|
||||||
address: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
,onReturnClick() {
|
|
||||||
window.history.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
,onSetDefaultClick(event, addressId) {
|
|
||||||
if (event.defaultPrevented) return;
|
|
||||||
this.$.defaultAddress.value = addressId;
|
|
||||||
Htk.Toast.showMessage(_('DefaultAddressModified'));
|
|
||||||
}
|
|
||||||
|
|
||||||
,async onRemoveAddressClick(form) {
|
|
||||||
if (confirm(_('AreYouSureDeleteAddress'))) {
|
|
||||||
await form.set('isActive', false);
|
|
||||||
await form.refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
,onEditAddressClick(address) {
|
|
||||||
this.hash.setAll({
|
|
||||||
form: 'account/address',
|
|
||||||
address
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
Addresses: Adreces
|
|
||||||
Return: Tornar
|
|
||||||
AddAddress: Afegir adreça
|
|
||||||
SetAsDefault: Establir com per defecte
|
|
||||||
RemoveAddress: Esborrar direcció
|
|
||||||
EditAddress: Modificar direcció
|
|
||||||
AreYouSureDeleteAddress: Estàs segur de que vols eliminar la direcció?
|
|
||||||
DefaultAddressModified: Adreça per defecte modificada
|
|
|
@ -1,8 +0,0 @@
|
||||||
Addresses: Addresses
|
|
||||||
Return: Return
|
|
||||||
AddAddress: Add address
|
|
||||||
SetAsDefault: Set as default
|
|
||||||
RemoveAddress: Remove address
|
|
||||||
EditAddress: Edit address
|
|
||||||
AreYouSureDeleteAddress: Are you sure you want to delete the address?
|
|
||||||
DefaultAddressModified: Default address modified
|
|
|
@ -1,8 +0,0 @@
|
||||||
Addresses: Direcciones
|
|
||||||
Return: Volver
|
|
||||||
AddAddress: Añadir dirección
|
|
||||||
SetAsDefault: Establecer como predeterminada
|
|
||||||
RemoveAddress: Borrar dirección
|
|
||||||
EditAddress: Modificar dirección
|
|
||||||
AreYouSureDeleteAddress: ¿Estás seguro de que quieres borrar la dirección?
|
|
||||||
DefaultAddressModified: Dirección por defecto modificada
|
|
|
@ -1,8 +0,0 @@
|
||||||
Addresses: Adresses
|
|
||||||
Return: Retour
|
|
||||||
AddAddress: Ajouter une adresse
|
|
||||||
SetAsDefault: Définir par défaut
|
|
||||||
RemoveAddress: Supprimer l'adresse
|
|
||||||
EditAddress: Changement d'adresse
|
|
||||||
AreYouSureDeleteAddress: Souhaitez-vous vraiment supprier l'adresse?
|
|
||||||
DefaultAddressModified: Adresse par défaut modifiée
|
|
|
@ -1,8 +0,0 @@
|
||||||
Addresses: Moradas
|
|
||||||
Return: Voltar
|
|
||||||
AddAddress: Adicionar Morada
|
|
||||||
SetAsDefault: Selecionar como pre-determinado
|
|
||||||
RemoveAddress: Eliminar Morada
|
|
||||||
EditAddress: Modificar Morada
|
|
||||||
AreYouSureDeleteAddress: Tens certeza que queres eliminar esta morada?
|
|
||||||
DefaultAddressModified: Endereço padrão modificado
|
|
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
hedera-address-list {
|
|
||||||
.htk-list .side {
|
|
||||||
padding-right: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
<vn>
|
|
||||||
<vn-group>
|
|
||||||
<db-form id="user-form">
|
|
||||||
<db-model property="model" id="user-model" updatable="true">
|
|
||||||
SELECT id, defaultAddressFk
|
|
||||||
FROM myClient c
|
|
||||||
</db-model>
|
|
||||||
</db-form>
|
|
||||||
<db-model id="addresses" updatable="true">
|
|
||||||
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">
|
|
||||||
<h1><t>Addresses</t></h1>
|
|
||||||
</div>
|
|
||||||
<div id="actions">
|
|
||||||
<htk-bar-button
|
|
||||||
icon="add"
|
|
||||||
tip="_AddAddress"
|
|
||||||
on-click="this.onAddAddressClick()"/>
|
|
||||||
</div>
|
|
||||||
<div id="form" class="hedera-address-list">
|
|
||||||
<div class="box vn-w-sm">
|
|
||||||
<htk-radio-group
|
|
||||||
id="default-address"
|
|
||||||
column="defaultAddressFk"
|
|
||||||
form="user-form"/>
|
|
||||||
<htk-repeater model="addresses" form-id="address" class="htk-list">
|
|
||||||
<custom>
|
|
||||||
<div class="item clickable" on-click="this.onSetDefaultClick($event, address.id)">
|
|
||||||
<div class="side">
|
|
||||||
<htk-radio
|
|
||||||
radio-group="default-address"
|
|
||||||
val="{{address.id}}"
|
|
||||||
tip="_SetAsDefault"
|
|
||||||
name="test"/>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<p class="important">
|
|
||||||
{{address.nickname}}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
{{address.street}}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
{{address.postalCode}}, {{address.city}}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="actions"
|
|
||||||
on-click="$event.preventDefault()">
|
|
||||||
<htk-button
|
|
||||||
icon="delete"
|
|
||||||
tip="_RemoveAddress"
|
|
||||||
on-click="this.onRemoveAddressClick($iter)"/>
|
|
||||||
<htk-button
|
|
||||||
icon="edit"
|
|
||||||
tip="_EditAddress"
|
|
||||||
on-click="this.onEditAddressClick(address.id)"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</custom>
|
|
||||||
</htk-repeater>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</vn>
|
|
|
@ -1,20 +0,0 @@
|
||||||
export default new Class({
|
|
||||||
Extends: Hedera.Form,
|
|
||||||
Template: require('./ui.xml'),
|
|
||||||
|
|
||||||
activate() {
|
|
||||||
this.$.model.setInfo('a', 'myAddress', 'hedera', ['id'], 'id');
|
|
||||||
this.$.model.setDefault('clientFk', 'a',
|
|
||||||
new Sql.Function({schema: 'account', name: 'myUser_getId'}));
|
|
||||||
},
|
|
||||||
|
|
||||||
onStatusChange() {
|
|
||||||
if (this.$.iter.ready && this.hash.$.address == 0)
|
|
||||||
this.$.iter.insertRow();
|
|
||||||
},
|
|
||||||
|
|
||||||
onOperationsDone() {
|
|
||||||
Htk.Toast.showMessage(_('AddressChangedSuccessfully'));
|
|
||||||
window.history.back()
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -1,10 +0,0 @@
|
||||||
AddEditAddress: Afegir o modificar adreça
|
|
||||||
Name: Consignatari
|
|
||||||
Address: Direcció
|
|
||||||
City: Ciutat
|
|
||||||
ZipCode: Codi postal
|
|
||||||
Country: País
|
|
||||||
Province: Província
|
|
||||||
Return: Tornar
|
|
||||||
Accept: Acceptar
|
|
||||||
AddressChangedSuccessfully: Adreça modificada correctament
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue