mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-13 10:14:57 +00:00
Compare commits
50 Commits
362-bug-ma
...
v3.11.0
Author | SHA1 | Date | |
---|---|---|---|
b830952b9e
|
|||
ad17313c61 | |||
620515ad15
|
|||
50c377ee22 | |||
cc7e7a90ee | |||
1d4ef19051
|
|||
8337a724d1
|
|||
8ca377d5d4 | |||
224e0bae43 | |||
3aa4fac80d | |||
|
a7517eb647 | ||
e278e636e0 | |||
|
40e373a9c7 | ||
1c1f418b18 | |||
bf0e14b43a | |||
203a098054
|
|||
d58acff541
|
|||
5858e05a42
|
|||
b9b4fafe14
|
|||
fe6949ea26 | |||
8a444a12f4 | |||
8b7b5ceed7
|
|||
b0e826d05a
|
|||
6fb9c3af3f
|
|||
7f101ba616
|
|||
cea82fac10 | |||
1344fc33e1 | |||
c8e09a28e6 | |||
c52d4b2a0e
|
|||
7f326d5441
|
|||
2840c06476 | |||
7ddf84ea5a | |||
f202625ea8
|
|||
7a9168fcdb
|
|||
40eb71f95a | |||
84b7cc8145 | |||
08af530726 | |||
03b2496817
|
|||
f638ce71fd | |||
b39997f00a | |||
38b21a2159 | |||
17db571244 | |||
8c8c16c1a1 | |||
046d3ec9f1 | |||
596833f1a5 | |||
66e4bab558 | |||
d1c9926bb1 | |||
a71d066765 | |||
217ac7b9e7 | |||
be901822bc |
@@ -1,6 +0,0 @@
|
||||
kind: DX
|
||||
body: Create an unique source of trust for translations
|
||||
time: 2025-01-31T13:18:01.239211506+01:00
|
||||
custom:
|
||||
Issue: "333"
|
||||
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
||||
kind: Feature
|
||||
body: Suggest all referrers within actions of the accompanying period when creating an activity
|
||||
time: 2025-01-30T12:02:07.053587034+01:00
|
||||
custom:
|
||||
Issue: "349"
|
||||
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
||||
kind: Feature
|
||||
body: Add possibility to export a csv with all social issues and social actions
|
||||
time: 2025-01-30T12:04:59.754998541+01:00
|
||||
custom:
|
||||
Issue: "343"
|
||||
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
||||
kind: Feature
|
||||
body: Restore document to previous kept version when a workflow is canceled
|
||||
time: 2025-02-14T15:03:28.707250207+01:00
|
||||
custom:
|
||||
Issue: "360"
|
||||
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
||||
kind: Feature
|
||||
body: Add a list of third parties from within the admin (csv download)
|
||||
time: 2025-02-19T12:09:28.487991703+01:00
|
||||
custom:
|
||||
Issue: "341"
|
||||
SchemaChange: No schema change
|
@@ -1,6 +0,0 @@
|
||||
kind: Fixed
|
||||
body: fix generation of document with accompanying period context, and list of activities and works
|
||||
time: 2025-02-14T12:10:10.920355454+01:00
|
||||
custom:
|
||||
Issue: ""
|
||||
SchemaChange: No schema change
|
6
.changes/v3.10.0.md
Normal file
6
.changes/v3.10.0.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## v3.10.0 - 2025-03-17
|
||||
### Feature
|
||||
* ([#363](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/363)) Display social actions grouped per social issue within activity form
|
||||
### Fixed
|
||||
* ([#362](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/362)) Fix Dependency Injection, which prevented to save the CalendarRange
|
||||
* ([#368](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/368)) fix search query for user groups
|
3
.changes/v3.10.1.md
Normal file
3
.changes/v3.10.1.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## v3.10.1 - 2025-03-17
|
||||
### DX
|
||||
* Remove yarn dependency to symfony/ux-translator, to ease the build process
|
3
.changes/v3.10.2.md
Normal file
3
.changes/v3.10.2.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## v3.10.2 - 2025-03-17
|
||||
### Fixed
|
||||
* Replace a ts-expect-error with a ts-ignore
|
3
.changes/v3.10.3.md
Normal file
3
.changes/v3.10.3.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## v3.10.3 - 2025-03-18
|
||||
### DX
|
||||
* Eslint fixes
|
19
.changes/v3.11.0.md
Normal file
19
.changes/v3.11.0.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## v3.11.0 - 2025-04-17
|
||||
### Feature
|
||||
* ([#365](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/365)) Add counters of actions and activities, with 2 boxes to (1) show the number of active actions on total actions and (2) show the number of activities in a accompanying period, and pills in menus for showing the number of active actions and the number of activities.
|
||||
* ([#364](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/364)) Added a second phone number "telephone2" to the thirdParty entity. Adapted twig templates and vuejs apps to handle this phone number
|
||||
|
||||
**Schema Change**: Add columns or tables
|
||||
* Signature: add a button to go directly to the signature zone, even if there is only one
|
||||
### Fixed
|
||||
* Fixed wrong translations in the on-the-fly for creation of thirdParty
|
||||
* Fixed update of phone number in on-the-fly edition of thirdParty
|
||||
* Fixed closing of modal when editing thirdParty in accompanying course works
|
||||
* Shorten the delay between two execution of AccompanyingPeriodStepChangeCronjob, to ensure at least one execution in a day
|
||||
* ([#102](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/102)) Fix display of title in document list
|
||||
* When cleaning the old stored object versions, do not throw an error if the stored object is not found on disk
|
||||
* Add consistent log prefix and key to logs when stale workflows are automatically canceled
|
||||
* ([#380](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/380)) Remove the "not null" validation constraint on recently added properties on HouseholdComposition
|
||||
|
||||
### DX
|
||||
* Add new chill-col style for displaying title and aside in a flex table
|
10
.changes/v3.9.0.md
Normal file
10
.changes/v3.9.0.md
Normal file
@@ -0,0 +1,10 @@
|
||||
## v3.9.0 - 2025-02-27
|
||||
### Feature
|
||||
* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity
|
||||
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions
|
||||
* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled
|
||||
* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download)
|
||||
### Fixed
|
||||
* fix generation of document with accompanying period context, and list of activities and works
|
||||
### DX
|
||||
* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations
|
3
.changes/v3.9.1.md
Normal file
3
.changes/v3.9.1.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## v3.9.1 - 2025-02-27
|
||||
### Fixed
|
||||
* Fix post/patch request with missing 'type' property for gender
|
3
.changes/v3.9.2.md
Normal file
3
.changes/v3.9.2.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## v3.9.2 - 2025-02-27
|
||||
### Fixed
|
||||
* Use fetchResults method to fetch all social issues instead of only the first page
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,6 +13,7 @@ docker/rabbitmq/data
|
||||
# in this development bundle, we want to ignore directories related to a real app
|
||||
assets/*
|
||||
!assets/translator.ts
|
||||
!assets/ux-translator
|
||||
migrations/*
|
||||
templates/*
|
||||
translations/*
|
||||
|
38
CHANGELOG.md
38
CHANGELOG.md
@@ -6,6 +6,44 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||
|
||||
|
||||
## v3.10.3 - 2025-03-18
|
||||
### DX
|
||||
* Eslint fixes
|
||||
|
||||
## v3.10.2 - 2025-03-17
|
||||
### Fixed
|
||||
* Replace a ts-expect-error with a ts-ignore
|
||||
|
||||
## v3.10.1 - 2025-03-17
|
||||
### DX
|
||||
* Remove yarn dependency to symfony/ux-translator, to ease the build process
|
||||
|
||||
## v3.10.0 - 2025-03-17
|
||||
### Feature
|
||||
* ([#363](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/363)) Display social actions grouped per social issue within activity form
|
||||
### Fixed
|
||||
* ([#362](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/362)) Fix Dependency Injection, which prevented to save the CalendarRange
|
||||
* ([#368](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/368)) fix search query for user groups
|
||||
|
||||
## v3.9.2 - 2025-02-27
|
||||
### Fixed
|
||||
* Use fetchResults method to fetch all social issues instead of only the first page
|
||||
|
||||
## v3.9.1 - 2025-02-27
|
||||
### Fixed
|
||||
* Fix post/patch request with missing 'type' property for gender
|
||||
|
||||
## v3.9.0 - 2025-02-27
|
||||
### Feature
|
||||
* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity
|
||||
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions
|
||||
* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled
|
||||
* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download)
|
||||
### Fixed
|
||||
* fix generation of document with accompanying period context, and list of activities and works
|
||||
### DX
|
||||
* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations
|
||||
|
||||
## v3.8.2 - 2025-02-10
|
||||
### Fixed
|
||||
* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal
|
||||
|
@@ -1,9 +1,7 @@
|
||||
// @ts-ignore Cannot find module (when used within an app)
|
||||
import { trans, getLocale, setLocale, setLocaleFallbacks } from "@symfony/ux-translator";
|
||||
import { trans, setLocale, setLocaleFallbacks } from "./ux-translator";
|
||||
|
||||
setLocaleFallbacks({"en": "fr", "nl": "fr", "fr": "en"});
|
||||
setLocale('fr');
|
||||
|
||||
export { trans };
|
||||
// @ts-ignore Cannot find module (when used within an app)
|
||||
export * from '../var/translations';
|
||||
|
3
assets/ux-translator/README.md
Normal file
3
assets/ux-translator/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
This directory import the symfony ux-translator files directly into chill-bundles.
|
||||
|
||||
This remove the yarn dependencies from the real package, which breaks our installation.
|
1
assets/ux-translator/dist/formatters/formatter.d.ts
vendored
Normal file
1
assets/ux-translator/dist/formatters/formatter.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function format(id: string, parameters: Record<string, string | number>, locale: string): string;
|
1
assets/ux-translator/dist/formatters/intl-formatter.d.ts
vendored
Normal file
1
assets/ux-translator/dist/formatters/intl-formatter.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function formatIntl(id: string, parameters: Record<string, string | number>, locale: string): string;
|
27
assets/ux-translator/dist/translator.d.ts
vendored
Normal file
27
assets/ux-translator/dist/translator.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
export type DomainType = string;
|
||||
export type LocaleType = string;
|
||||
export type TranslationsType = Record<DomainType, {
|
||||
parameters: ParametersType;
|
||||
}>;
|
||||
export type NoParametersType = Record<string, never>;
|
||||
export type ParametersType = Record<string, string | number | Date> | NoParametersType;
|
||||
export type RemoveIntlIcuSuffix<T> = T extends `${infer U}+intl-icu` ? U : T;
|
||||
export type DomainsOf<M> = M extends Message<infer Translations, LocaleType> ? keyof Translations : never;
|
||||
export type LocaleOf<M> = M extends Message<TranslationsType, infer Locale> ? Locale : never;
|
||||
export type ParametersOf<M, D extends DomainType> = M extends Message<infer Translations, LocaleType> ? Translations[D] extends {
|
||||
parameters: infer Parameters;
|
||||
} ? Parameters : never : never;
|
||||
export interface Message<Translations extends TranslationsType, Locale extends LocaleType> {
|
||||
id: string;
|
||||
translations: {
|
||||
[domain in DomainType]: {
|
||||
[locale in Locale]: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export declare function setLocale(locale: LocaleType | null): void;
|
||||
export declare function getLocale(): LocaleType;
|
||||
export declare function throwWhenNotFound(enabled: boolean): void;
|
||||
export declare function setLocaleFallbacks(localeFallbacks: Record<LocaleType, LocaleType>): void;
|
||||
export declare function getLocaleFallbacks(): Record<LocaleType, LocaleType>;
|
||||
export declare function trans<M extends Message<TranslationsType, LocaleType>, D extends DomainsOf<M>, P extends ParametersOf<M, D>>(...args: P extends NoParametersType ? [message: M, parameters?: P, domain?: RemoveIntlIcuSuffix<D>, locale?: LocaleOf<M>] : [message: M, parameters: P, domain?: RemoveIntlIcuSuffix<D>, locale?: LocaleOf<M>]): string;
|
1
assets/ux-translator/dist/translator_controller.d.ts
vendored
Normal file
1
assets/ux-translator/dist/translator_controller.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './translator';
|
283
assets/ux-translator/dist/translator_controller.js
vendored
Normal file
283
assets/ux-translator/dist/translator_controller.js
vendored
Normal file
@@ -0,0 +1,283 @@
|
||||
import { IntlMessageFormat } from 'intl-messageformat';
|
||||
|
||||
function strtr(string, replacePairs) {
|
||||
const regex = Object.entries(replacePairs).map(([from]) => {
|
||||
return from.replace(/([-[\]{}()*+?.\\^$|#,])/g, '\\$1');
|
||||
});
|
||||
if (regex.length === 0) {
|
||||
return string;
|
||||
}
|
||||
return string.replace(new RegExp(regex.join('|'), 'g'), (matched) => replacePairs[matched].toString());
|
||||
}
|
||||
|
||||
function format(id, parameters, locale) {
|
||||
if (null === id || '' === id) {
|
||||
return '';
|
||||
}
|
||||
if (typeof parameters['%count%'] === 'undefined' || Number.isNaN(parameters['%count%'])) {
|
||||
return strtr(id, parameters);
|
||||
}
|
||||
const number = Number(parameters['%count%']);
|
||||
let parts = [];
|
||||
if (/^\|+$/.test(id)) {
|
||||
parts = id.split('|');
|
||||
}
|
||||
else {
|
||||
parts = id.match(/(?:\|\||[^|])+/g) || [];
|
||||
}
|
||||
const intervalRegex = /^(?<interval>({\s*(-?\d+(\.\d+)?[\s*,\s*\-?\d+(.\d+)?]*)\s*})|(?<left_delimiter>[[\]])\s*(?<left>-Inf|-?\d+(\.\d+)?)\s*,\s*(?<right>\+?Inf|-?\d+(\.\d+)?)\s*(?<right_delimiter>[[\]]))\s*(?<message>.*?)$/s;
|
||||
const standardRules = [];
|
||||
for (let part of parts) {
|
||||
part = part.trim().replace(/\|\|/g, '|');
|
||||
const matches = part.match(intervalRegex);
|
||||
if (matches) {
|
||||
const matchGroups = matches.groups || {};
|
||||
if (matches[2]) {
|
||||
for (const n of matches[3].split(',')) {
|
||||
if (number === Number(n)) {
|
||||
return strtr(matchGroups.message, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const leftNumber = '-Inf' === matchGroups.left ? Number.NEGATIVE_INFINITY : Number(matchGroups.left);
|
||||
const rightNumber = ['Inf', '+Inf'].includes(matchGroups.right)
|
||||
? Number.POSITIVE_INFINITY
|
||||
: Number(matchGroups.right);
|
||||
if (('[' === matchGroups.left_delimiter ? number >= leftNumber : number > leftNumber) &&
|
||||
(']' === matchGroups.right_delimiter ? number <= rightNumber : number < rightNumber)) {
|
||||
return strtr(matchGroups.message, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const ruleMatch = part.match(/^\w+:\s*(.*?)$/);
|
||||
standardRules.push(ruleMatch ? ruleMatch[1] : part);
|
||||
}
|
||||
}
|
||||
const position = getPluralizationRule(number, locale);
|
||||
if (typeof standardRules[position] === 'undefined') {
|
||||
if (1 === parts.length && typeof standardRules[0] !== 'undefined') {
|
||||
return strtr(standardRules[0], parameters);
|
||||
}
|
||||
throw new Error(`Unable to choose a translation for "${id}" with locale "${locale}" for value "${number}". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples").`);
|
||||
}
|
||||
return strtr(standardRules[position], parameters);
|
||||
}
|
||||
function getPluralizationRule(number, locale) {
|
||||
number = Math.abs(number);
|
||||
let _locale = locale;
|
||||
if (locale === 'pt_BR' || locale === 'en_US_POSIX') {
|
||||
return 0;
|
||||
}
|
||||
_locale = _locale.length > 3 ? _locale.substring(0, _locale.indexOf('_')) : _locale;
|
||||
switch (_locale) {
|
||||
case 'af':
|
||||
case 'bn':
|
||||
case 'bg':
|
||||
case 'ca':
|
||||
case 'da':
|
||||
case 'de':
|
||||
case 'el':
|
||||
case 'en':
|
||||
case 'en_US_POSIX':
|
||||
case 'eo':
|
||||
case 'es':
|
||||
case 'et':
|
||||
case 'eu':
|
||||
case 'fa':
|
||||
case 'fi':
|
||||
case 'fo':
|
||||
case 'fur':
|
||||
case 'fy':
|
||||
case 'gl':
|
||||
case 'gu':
|
||||
case 'ha':
|
||||
case 'he':
|
||||
case 'hu':
|
||||
case 'is':
|
||||
case 'it':
|
||||
case 'ku':
|
||||
case 'lb':
|
||||
case 'ml':
|
||||
case 'mn':
|
||||
case 'mr':
|
||||
case 'nah':
|
||||
case 'nb':
|
||||
case 'ne':
|
||||
case 'nl':
|
||||
case 'nn':
|
||||
case 'no':
|
||||
case 'oc':
|
||||
case 'om':
|
||||
case 'or':
|
||||
case 'pa':
|
||||
case 'pap':
|
||||
case 'ps':
|
||||
case 'pt':
|
||||
case 'so':
|
||||
case 'sq':
|
||||
case 'sv':
|
||||
case 'sw':
|
||||
case 'ta':
|
||||
case 'te':
|
||||
case 'tk':
|
||||
case 'ur':
|
||||
case 'zu':
|
||||
return 1 === number ? 0 : 1;
|
||||
case 'am':
|
||||
case 'bh':
|
||||
case 'fil':
|
||||
case 'fr':
|
||||
case 'gun':
|
||||
case 'hi':
|
||||
case 'hy':
|
||||
case 'ln':
|
||||
case 'mg':
|
||||
case 'nso':
|
||||
case 'pt_BR':
|
||||
case 'ti':
|
||||
case 'wa':
|
||||
return number < 2 ? 0 : 1;
|
||||
case 'be':
|
||||
case 'bs':
|
||||
case 'hr':
|
||||
case 'ru':
|
||||
case 'sh':
|
||||
case 'sr':
|
||||
case 'uk':
|
||||
return 1 === number % 10 && 11 !== number % 100
|
||||
? 0
|
||||
: number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)
|
||||
? 1
|
||||
: 2;
|
||||
case 'cs':
|
||||
case 'sk':
|
||||
return 1 === number ? 0 : number >= 2 && number <= 4 ? 1 : 2;
|
||||
case 'ga':
|
||||
return 1 === number ? 0 : 2 === number ? 1 : 2;
|
||||
case 'lt':
|
||||
return 1 === number % 10 && 11 !== number % 100
|
||||
? 0
|
||||
: number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20)
|
||||
? 1
|
||||
: 2;
|
||||
case 'sl':
|
||||
return 1 === number % 100 ? 0 : 2 === number % 100 ? 1 : 3 === number % 100 || 4 === number % 100 ? 2 : 3;
|
||||
case 'mk':
|
||||
return 1 === number % 10 ? 0 : 1;
|
||||
case 'mt':
|
||||
return 1 === number
|
||||
? 0
|
||||
: 0 === number || (number % 100 > 1 && number % 100 < 11)
|
||||
? 1
|
||||
: number % 100 > 10 && number % 100 < 20
|
||||
? 2
|
||||
: 3;
|
||||
case 'lv':
|
||||
return 0 === number ? 0 : 1 === number % 10 && 11 !== number % 100 ? 1 : 2;
|
||||
case 'pl':
|
||||
return 1 === number
|
||||
? 0
|
||||
: number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 12 || number % 100 > 14)
|
||||
? 1
|
||||
: 2;
|
||||
case 'cy':
|
||||
return 1 === number ? 0 : 2 === number ? 1 : 8 === number || 11 === number ? 2 : 3;
|
||||
case 'ro':
|
||||
return 1 === number ? 0 : 0 === number || (number % 100 > 0 && number % 100 < 20) ? 1 : 2;
|
||||
case 'ar':
|
||||
return 0 === number
|
||||
? 0
|
||||
: 1 === number
|
||||
? 1
|
||||
: 2 === number
|
||||
? 2
|
||||
: number % 100 >= 3 && number % 100 <= 10
|
||||
? 3
|
||||
: number % 100 >= 11 && number % 100 <= 99
|
||||
? 4
|
||||
: 5;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function formatIntl(id, parameters, locale) {
|
||||
if (id === '') {
|
||||
return '';
|
||||
}
|
||||
const intlMessage = new IntlMessageFormat(id, [locale.replace('_', '-')], undefined, { ignoreTag: true });
|
||||
parameters = { ...parameters };
|
||||
Object.entries(parameters).forEach(([key, value]) => {
|
||||
if (key.includes('%') || key.includes('{')) {
|
||||
delete parameters[key];
|
||||
parameters[key.replace(/[%{} ]/g, '').trim()] = value;
|
||||
}
|
||||
});
|
||||
return intlMessage.format(parameters);
|
||||
}
|
||||
|
||||
let _locale = null;
|
||||
let _localeFallbacks = {};
|
||||
let _throwWhenNotFound = false;
|
||||
function setLocale(locale) {
|
||||
_locale = locale;
|
||||
}
|
||||
function getLocale() {
|
||||
return (_locale ||
|
||||
document.documentElement.getAttribute('data-symfony-ux-translator-locale') ||
|
||||
(document.documentElement.lang ? document.documentElement.lang.replace('-', '_') : null) ||
|
||||
'en');
|
||||
}
|
||||
function throwWhenNotFound(enabled) {
|
||||
_throwWhenNotFound = enabled;
|
||||
}
|
||||
function setLocaleFallbacks(localeFallbacks) {
|
||||
_localeFallbacks = localeFallbacks;
|
||||
}
|
||||
function getLocaleFallbacks() {
|
||||
return _localeFallbacks;
|
||||
}
|
||||
function trans(message, parameters = {}, domain = 'messages', locale = null) {
|
||||
if (typeof domain === 'undefined') {
|
||||
domain = 'messages';
|
||||
}
|
||||
if (typeof locale === 'undefined' || null === locale) {
|
||||
locale = getLocale();
|
||||
}
|
||||
if (typeof message.translations === 'undefined') {
|
||||
return message.id;
|
||||
}
|
||||
const localesFallbacks = getLocaleFallbacks();
|
||||
const translationsIntl = message.translations[`${domain}+intl-icu`];
|
||||
if (typeof translationsIntl !== 'undefined') {
|
||||
while (typeof translationsIntl[locale] === 'undefined') {
|
||||
locale = localesFallbacks[locale];
|
||||
if (!locale) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (locale) {
|
||||
return formatIntl(translationsIntl[locale], parameters, locale);
|
||||
}
|
||||
}
|
||||
const translations = message.translations[domain];
|
||||
if (typeof translations !== 'undefined') {
|
||||
while (typeof translations[locale] === 'undefined') {
|
||||
locale = localesFallbacks[locale];
|
||||
if (!locale) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (locale) {
|
||||
return format(translations[locale], parameters, locale);
|
||||
}
|
||||
}
|
||||
if (_throwWhenNotFound) {
|
||||
throw new Error(`No translation message found with id "${message.id}".`);
|
||||
}
|
||||
return message.id;
|
||||
}
|
||||
|
||||
export { getLocale, getLocaleFallbacks, setLocale, setLocaleFallbacks, throwWhenNotFound, trans };
|
1
assets/ux-translator/dist/utils.d.ts
vendored
Normal file
1
assets/ux-translator/dist/utils.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function strtr(string: string, replacePairs: Record<string, string | number>): string;
|
34
assets/ux-translator/package.json
Normal file
34
assets/ux-translator/package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@symfony/ux-translator",
|
||||
"description": "Symfony Translator for JavaScript",
|
||||
"license": "MIT",
|
||||
"version": "1.0.0",
|
||||
"main": "dist/translator_controller.js",
|
||||
"types": "dist/translator_controller.d.ts",
|
||||
"scripts": {
|
||||
"build": "node ../../../bin/build_package.js .",
|
||||
"watch": "node ../../../bin/build_package.js . --watch",
|
||||
"test": "../../../bin/test_package.sh .",
|
||||
"check": "biome check",
|
||||
"ci": "biome ci"
|
||||
},
|
||||
"symfony": {
|
||||
"importmap": {
|
||||
"intl-messageformat": "^10.5.11",
|
||||
"@symfony/ux-translator": "path:%PACKAGE%/dist/translator_controller.js",
|
||||
"@app/translations": "path:var/translations/index.js",
|
||||
"@app/translations/configuration": "path:var/translations/configuration.js"
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"intl-messageformat": "^10.5.11"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"intl-messageformat": {
|
||||
"optional": false
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"intl-messageformat": "^10.5.11"
|
||||
}
|
||||
}
|
@@ -34,6 +34,7 @@ export default ts.config(
|
||||
// override/add rules settings here, such as:
|
||||
"vue/multi-word-component-names": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
},
|
||||
},
|
||||
);
|
||||
|
@@ -58,6 +58,7 @@
|
||||
"bootstrap-icons": "^1.11.3",
|
||||
"dropzone": "^5.7.6",
|
||||
"es6-promise": "^4.2.8",
|
||||
"intl-messageformat": "^10.5.11",
|
||||
"leaflet": "^1.7.1",
|
||||
"marked": "^12.0.2",
|
||||
"masonry-layout": "^4.2.2",
|
||||
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Menu;
|
||||
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
@@ -23,22 +24,30 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(protected Security $security, protected TranslatorInterface $translator) {}
|
||||
public function __construct(
|
||||
protected Security $security,
|
||||
protected TranslatorInterface $translator,
|
||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||
) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
$period = $parameters['accompanyingCourse'];
|
||||
|
||||
$activities = $this->managerRegistry->getManager()->getRepository(Activity::class)->findBy(
|
||||
['accompanyingPeriod' => $period]
|
||||
);
|
||||
|
||||
if (
|
||||
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
||||
) {
|
||||
$menu->addChild($this->translator->trans('Activity'), [
|
||||
$menu->addChild($this->translator->trans('Activities'), [
|
||||
'route' => 'chill_activity_activity_list',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 40]);
|
||||
->setExtras(['order' => 40, 'counter' => count($activities) > 0 ? count($activities) : null]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Menu;
|
||||
|
||||
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
@@ -23,13 +24,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {}
|
||||
public function __construct(
|
||||
private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
||||
private AuthorizationCheckerInterface $authorizationChecker,
|
||||
private TranslatorInterface $translator,
|
||||
) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
/** @var Person $person */
|
||||
$person = $parameters['person'];
|
||||
|
||||
|
||||
$count = $this->activityACLAwareRepository->countByPerson($person, ActivityVoter::SEE);
|
||||
|
||||
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Activities'),
|
||||
@@ -38,7 +46,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
'routeParameters' => ['person_id' => $person->getId()],
|
||||
]
|
||||
)
|
||||
->setExtra('order', 201);
|
||||
->setExtras(['order' => 201, 'counter' => $count > 0 ? $count : null]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -120,3 +120,34 @@ li.document-list-item {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
}
|
||||
|
||||
.badge-activity-type-simple {
|
||||
@extend .badge;
|
||||
display: inline-block;
|
||||
margin: 0.2rem 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0.5rem;
|
||||
|
||||
border-left: 20px groove #9acd32;
|
||||
border-radius: $badge-border-radius;
|
||||
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
font-size: unset;
|
||||
max-width: 100%;
|
||||
background-color: $gray-100;
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-indent: 5px hanging;
|
||||
text-align: left;
|
||||
|
||||
&::before {
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
left: -0.5px;
|
||||
font-family: ForkAwesome;
|
||||
content: '\f04b';
|
||||
color: #9acd32;
|
||||
}
|
||||
}
|
||||
|
@@ -68,14 +68,23 @@
|
||||
socialActionsSelected.length)
|
||||
"
|
||||
>
|
||||
<check-social-action
|
||||
v-for="action in socialActionsList"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected"
|
||||
<div
|
||||
id="actionsList"
|
||||
v-for="group in socialActionsList"
|
||||
:key="group.issue"
|
||||
>
|
||||
</check-social-action>
|
||||
<span class="badge bg-chill-l-gray text-dark">{{
|
||||
group.issue
|
||||
}}</span>
|
||||
<check-social-action
|
||||
v-for="action in group.actions"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected"
|
||||
>
|
||||
</check-social-action>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<span
|
||||
@@ -149,53 +158,44 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
/* Load others issues in multiselect
|
||||
*/
|
||||
/* Load other issues in multiselect */
|
||||
this.issueIsLoading = true;
|
||||
this.actionAreLoaded = false;
|
||||
getSocialIssues().then(
|
||||
(response) =>
|
||||
new Promise((resolve) => {
|
||||
this.$store.commit("updateIssuesOther", response.results);
|
||||
|
||||
/* Add in list the issues already associated (if not yet listed)
|
||||
*/
|
||||
this.socialIssuesSelected.forEach((issue) => {
|
||||
if (
|
||||
this.socialIssuesList.filter(
|
||||
(i) => i.id === issue.id,
|
||||
).length !== 1
|
||||
) {
|
||||
this.$store.commit("addIssueInList", issue);
|
||||
}
|
||||
}, this);
|
||||
getSocialIssues().then((response) => {
|
||||
/* Add issues to the store */
|
||||
this.$store.commit("updateIssuesOther", response);
|
||||
|
||||
/* Remove from multiselect the issues that are not yet in checkbox list
|
||||
*/
|
||||
this.socialIssuesList.forEach((issue) => {
|
||||
this.$store.commit("removeIssueInOther", issue);
|
||||
}, this);
|
||||
/* Add in list the issues already associated (if not yet listed) */
|
||||
this.socialIssuesSelected.forEach((issue) => {
|
||||
if (
|
||||
this.socialIssuesList.filter((i) => i.id === issue.id)
|
||||
.length !== 1
|
||||
) {
|
||||
this.$store.commit("addIssueInList", issue);
|
||||
}
|
||||
});
|
||||
|
||||
/* Filter issues
|
||||
*/
|
||||
this.$store.commit("filterList", "issues");
|
||||
/* Remove from multiselect the issues that are not yet in the checkbox list */
|
||||
this.socialIssuesList.forEach((issue) => {
|
||||
this.$store.commit("removeIssueInOther", issue);
|
||||
});
|
||||
|
||||
/* Add in list the actions already associated (if not yet listed)
|
||||
*/
|
||||
this.socialActionsSelected.forEach((action) => {
|
||||
this.$store.commit("addActionInList", action);
|
||||
}, this);
|
||||
/* Filter issues */
|
||||
this.$store.commit("filterList", "issues");
|
||||
|
||||
/* Filter issues
|
||||
*/
|
||||
this.$store.commit("filterList", "actions");
|
||||
/* Add in list the actions already associated (if not yet listed) */
|
||||
this.socialActionsSelected.forEach((action) => {
|
||||
this.$store.commit("addActionInList", action);
|
||||
});
|
||||
|
||||
this.issueIsLoading = false;
|
||||
this.actionAreLoaded = true;
|
||||
this.updateActionsList();
|
||||
resolve();
|
||||
}),
|
||||
);
|
||||
/* Filter actions */
|
||||
this.$store.commit("filterList", "actions");
|
||||
|
||||
this.issueIsLoading = false;
|
||||
this.actionAreLoaded = true;
|
||||
this.updateActionsList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/* When choosing an issue in multiselect, add it in checkboxes (as selected),
|
||||
@@ -258,7 +258,23 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "ChillMainAssets/module/bootstrap/shared";
|
||||
@import "ChillPersonAssets/chill/scss/mixins";
|
||||
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||
|
||||
span.multiselect__single {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#actionsList {
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
margin: 0.5rem;
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
span.badge {
|
||||
margin-bottom: 0.5rem;
|
||||
@include badge_social($social-issue-color);
|
||||
}
|
||||
</style>
|
||||
|
@@ -10,7 +10,9 @@
|
||||
:value="action"
|
||||
/>
|
||||
<label class="form-check-label" :for="action.id">
|
||||
<span class="badge bg-light text-dark">{{ action.text }}</span>
|
||||
<span class="badge bg-light text-dark" :title="action.text">{{
|
||||
action.text
|
||||
}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</span>
|
||||
@@ -43,5 +45,9 @@ span.badge {
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
max-width: 100%; /* Adjust as needed */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
@@ -124,9 +124,19 @@ const store = createStore({
|
||||
);
|
||||
},
|
||||
socialActionsListSorted(state) {
|
||||
return [...state.socialActionsList].sort(
|
||||
(a, b) => a.ordering - b.ordering,
|
||||
);
|
||||
return [...state.socialActionsList]
|
||||
.sort((a, b) => a.ordering - b.ordering)
|
||||
.reduce((acc, action) => {
|
||||
const issueText = action.issue?.text || "Uncategorized";
|
||||
// Find if the group for the issue already exists
|
||||
let group = acc.find((item) => item.issue === issueText);
|
||||
if (!group) {
|
||||
group = { issue: issueText, actions: [] };
|
||||
acc.push(group);
|
||||
}
|
||||
group.actions.push(action);
|
||||
return acc;
|
||||
}, []);
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
|
@@ -13,44 +13,44 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col" style="width: unset">
|
||||
{% if document.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{% if activity.accompanyingPeriod is not null and context == 'person' %}
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ activity.accompanyingPeriod.id }}
|
||||
</span>
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">
|
||||
{% if document.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<div class="badge-activity-type">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">
|
||||
{{ activity.type.name | localize_translatable_string }}
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div class="badge-activity-type-simple">
|
||||
{{ activity.type.name | localize_translatable_string }}
|
||||
</div>
|
||||
{% if activity.emergency %}
|
||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.template.name|localize_translatable_string }}</p>
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="item-col">
|
||||
<div class="container">
|
||||
{% if document.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="aside">
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.createdAt|format_date('short') }}</span>
|
||||
</div>
|
||||
{% if activity.accompanyingPeriod is not null and context == 'person' %}
|
||||
<div class="text-end">
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ activity.accompanyingPeriod.id }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
||||
@import '~ChillMainAssets/module/bootstrap/shared';
|
||||
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
||||
@import 'bootstrap/scss/_badge.scss';
|
||||
|
||||
.badge-calendar {
|
||||
display: inline-block;
|
||||
@@ -23,3 +24,35 @@
|
||||
}
|
||||
}
|
||||
|
||||
.badge-calendar-simple {
|
||||
@extend .badge;
|
||||
display: inline-block;
|
||||
margin: 0.2rem 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0.5rem;
|
||||
|
||||
border-left: 20px groove $chill-l-gray;
|
||||
border-radius: $badge-border-radius;
|
||||
|
||||
max-width: 100%;
|
||||
background-color: $gray-100;
|
||||
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
overflow: hidden;
|
||||
font-weight: normal;
|
||||
font-size: unset;
|
||||
text-overflow: ellipsis;
|
||||
text-indent: 5px hanging;
|
||||
text-align: left;
|
||||
|
||||
&::before {
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
left: -0.5px;
|
||||
font-family: ForkAwesome;
|
||||
content: '\f04b';
|
||||
color: $chill-l-gray;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ div.calendar-list {
|
||||
}
|
||||
|
||||
& > a.calendar-list__global {
|
||||
display: inline-block;;
|
||||
display: inline-block;
|
||||
padding: 0.2rem;
|
||||
min-width: 2rem;
|
||||
border: 1px solid var(--bs-chill-blue);
|
||||
|
@@ -96,13 +96,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||
<template v-slot:eventContent="arg: EventApi">
|
||||
<template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
|
||||
<span :class="eventClasses(arg.event)">
|
||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
||||
arg.event.title
|
||||
}}</b>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||
>{{ arg.timeText }} -
|
||||
>{{ arg.event.startStr }} -
|
||||
{{ arg.event.extendedProps.locationName }}</b
|
||||
>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||
|
@@ -6,50 +6,48 @@
|
||||
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col" style="width: unset">
|
||||
{% if document.storedObject.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{% if c.accompanyingPeriod is not null and context == 'person' %}
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ c.accompanyingPeriod.id }}
|
||||
</span>
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">
|
||||
{% if document.storedObject.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
<span class="badge-calendar">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">
|
||||
{{ 'Calendar'|trans }}
|
||||
{% if c.endDate.diff(c.startDate).days >= 1 %}
|
||||
{{ c.startDate|format_datetime('short', 'short') }}
|
||||
- {{ c.endDate|format_datetime('short', 'short') }}
|
||||
{% else %}
|
||||
{{ c.startDate|format_datetime('short', 'short') }}
|
||||
- {{ c.endDate|format_datetime('none', 'short') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="denomination h2">
|
||||
{{ document.storedObject.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.storedObject.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="item-col">
|
||||
<div class="container">
|
||||
<span class="badge-calendar-simple">
|
||||
{{ 'Calendar'|trans }}
|
||||
{% if c.endDate.diff(c.startDate).days >= 1 %}
|
||||
{{ c.startDate|format_datetime('short', 'short') }}
|
||||
- {{ c.endDate|format_datetime('short', 'short') }}
|
||||
{% else %}
|
||||
{{ c.startDate|format_datetime('short', 'short') }}
|
||||
- {{ c.endDate|format_datetime('none', 'short') }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="denomination h2">
|
||||
{{ document.storedObject.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.storedObject.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="aside">
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.storedObject.createdAt|format_date('short') }}</span>
|
||||
</div>
|
||||
{% if c.accompanyingPeriod is not null and context == 'person' %}
|
||||
<div class="text-end">
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ c.accompanyingPeriod.id }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -2,26 +2,28 @@
|
||||
<teleport to="body">
|
||||
<modal v-if="modalOpen" @close="modalOpen = false">
|
||||
<template v-slot:header>
|
||||
<h2>{{ $t("signature_confirmation") }}</h2>
|
||||
<h2>{{ trans(SIGNATURES_SIGNATURE_CONFIRMATION) }}</h2>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<div class="signature-modal-body text-center" v-if="loading">
|
||||
<p>{{ $t("electronic_signature_in_progress") }}</p>
|
||||
<p>
|
||||
{{ trans(SIGNATURES_ELECTRONIC_SIGNATURE_IN_PROGRESS) }}
|
||||
</p>
|
||||
<div class="loading">
|
||||
<i
|
||||
class="fa fa-circle-o-notch fa-spin fa-3x"
|
||||
:title="$t('loading')"
|
||||
:title="trans(SIGNATURES_LOADING)"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="signature-modal-body text-center" v-else>
|
||||
<p>{{ $t("you_are_going_to_sign") }}</p>
|
||||
<p>{{ $t("are_you_sure") }}</p>
|
||||
<p>{{ trans(SIGNATURES_YOU_ARE_GOING_TO_SIGN) }}</p>
|
||||
<p>{{ trans(SIGNATURES_ARE_YOU_SURE) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button class="btn btn-action" @click.prevent="confirmSign">
|
||||
{{ $t("yes") }}
|
||||
{{ trans(SIGNATURES_YES) }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
@@ -82,33 +84,39 @@
|
||||
@change="toggleMultiPage"
|
||||
/>
|
||||
<label class="form-check-label" for="checkboxMulti">
|
||||
{{ $t("all_pages") }}
|
||||
{{ trans(SIGNATURES_ALL_PAGES) }}
|
||||
</label>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 0"
|
||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||
class="col-5 p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="goToSignatureZoneUnique"
|
||||
>
|
||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 1"
|
||||
class="col-5 p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
:disabled="isFirstSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ $t("last_zone") }}
|
||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
:disabled="isLastSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_zone") }}
|
||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -117,9 +125,9 @@
|
||||
:hidden="!userSignatureZone"
|
||||
@click="undoSign"
|
||||
v-if="signature.zones.length > 1"
|
||||
:title="$t('choose_another_signature')"
|
||||
:title="trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE)"
|
||||
>
|
||||
{{ $t("another_zone") }}
|
||||
{{ trans(SIGNATURES_ANOTHER_ZONE) }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-misc btn-sm"
|
||||
@@ -127,7 +135,7 @@
|
||||
@click="undoSign"
|
||||
v-else
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="userSignatureZone === null"
|
||||
@@ -139,7 +147,7 @@
|
||||
active: canvasEvent === 'add',
|
||||
}"
|
||||
@click="toggleAddZone()"
|
||||
:title="$t('add_sign_zone')"
|
||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||
>
|
||||
<template v-if="canvasEvent === 'add'">
|
||||
<div
|
||||
@@ -191,58 +199,70 @@
|
||||
@change="toggleMultiPage"
|
||||
/>
|
||||
<label class="form-check-label" for="checkboxMulti">
|
||||
{{ $t("see_all_pages") }}
|
||||
{{ trans(SIGNATURES_SEE_ALL_PAGES) }}
|
||||
</label>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 0 && signedState !== 'signed'"
|
||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
@click="goToSignatureZoneUnique"
|
||||
>
|
||||
{{ $t("last_zone") }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_zone") }}
|
||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 0 && signedState !== 'signed'"
|
||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||
v-if="signature.zones.length > 1 && signedState !== 'signed'"
|
||||
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||
>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone === null ||
|
||||
userSignatureZone?.index < 1
|
||||
"
|
||||
:disabled="isFirstSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ $t("last_sign_zone") }}
|
||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="
|
||||
userSignatureZone?.index >= signature.zones.length - 1
|
||||
"
|
||||
:disabled="isLastSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ $t("next_sign_zone") }}
|
||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
class="btn btn-light btn-sm"
|
||||
@click="goToSignatureZoneUnique"
|
||||
>
|
||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="signature.zones.length > 1 && signedState !== 'signed'"
|
||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||
>
|
||||
<button
|
||||
:disabled="isFirstSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(-1)"
|
||||
>
|
||||
{{ trans(SIGNATURES_LAST_SIGN_ZONE) }}
|
||||
</button>
|
||||
<span>|</span>
|
||||
<button
|
||||
:disabled="isLastSignatureZone()"
|
||||
class="btn btn-light btn-sm"
|
||||
@click="turnSignature(1)"
|
||||
>
|
||||
{{ trans(SIGNATURES_NEXT_SIGN_ZONE) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -252,7 +272,7 @@
|
||||
@click="undoSign"
|
||||
v-if="signature.zones.length > 1"
|
||||
>
|
||||
{{ $t("choose_another_signature") }}
|
||||
{{ trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE) }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-misc btn-sm"
|
||||
@@ -260,7 +280,7 @@
|
||||
@click="undoSign"
|
||||
v-else
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="userSignatureZone === null"
|
||||
@@ -272,13 +292,13 @@
|
||||
active: canvasEvent === 'add',
|
||||
}"
|
||||
@click="toggleAddZone()"
|
||||
:title="$t('add_sign_zone')"
|
||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||
>
|
||||
<template v-if="canvasEvent !== 'add'">
|
||||
{{ $t("add_zone") }}
|
||||
{{ trans(SIGNATURES_ADD_ZONE) }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ $t("click_on_document") }}
|
||||
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
||||
<div
|
||||
class="spinner-border spinner-border-sm"
|
||||
role="status"
|
||||
@@ -312,10 +332,10 @@
|
||||
v-if="signedState !== 'signed'"
|
||||
:href="getReturnPath()"
|
||||
>
|
||||
{{ $t("cancel") }}
|
||||
{{ trans(SIGNATURES_CANCEL) }}
|
||||
</a>
|
||||
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
||||
{{ $t("return") }}
|
||||
{{ trans(SIGNATURES_RETURN) }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||
@@ -324,7 +344,7 @@
|
||||
:disabled="!userSignatureZone"
|
||||
@click="sign"
|
||||
>
|
||||
{{ $t("sign") }}
|
||||
{{ trans(SIGNATURES_SIGN) }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4" v-else></div>
|
||||
@@ -333,7 +353,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, Ref, reactive } from "vue";
|
||||
import { ref, Ref } from "vue";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
import "vue-toast-notification/dist/theme-sugar.css";
|
||||
import {
|
||||
@@ -344,25 +364,47 @@ import {
|
||||
SignedState,
|
||||
ZoomLevel,
|
||||
} from "../../types";
|
||||
import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import * as pdfjsLib from "pdfjs-dist";
|
||||
import {
|
||||
PDFDocumentProxy,
|
||||
PDFPageProxy,
|
||||
} from "pdfjs-dist/types/src/display/api";
|
||||
|
||||
// @ts-ignore
|
||||
import {
|
||||
SIGNATURES_YES,
|
||||
SIGNATURES_ARE_YOU_SURE,
|
||||
SIGNATURES_YOU_ARE_GOING_TO_SIGN,
|
||||
SIGNATURES_SIGNATURE_CONFIRMATION,
|
||||
SIGNATURES_SIGN,
|
||||
SIGNATURES_CHOOSE_ANOTHER_SIGNATURE,
|
||||
SIGNATURES_CANCEL,
|
||||
SIGNATURES_LAST_SIGN_ZONE,
|
||||
SIGNATURES_NEXT_SIGN_ZONE,
|
||||
SIGNATURES_ADD_SIGN_ZONE,
|
||||
SIGNATURES_CLICK_ON_DOCUMENT,
|
||||
SIGNATURES_LAST_ZONE,
|
||||
SIGNATURES_NEXT_ZONE,
|
||||
SIGNATURES_ADD_ZONE,
|
||||
SIGNATURES_ANOTHER_ZONE,
|
||||
SIGNATURES_ELECTRONIC_SIGNATURE_IN_PROGRESS,
|
||||
SIGNATURES_LOADING,
|
||||
SIGNATURES_RETURN,
|
||||
SIGNATURES_SEE_ALL_PAGES,
|
||||
SIGNATURES_ALL_PAGES,
|
||||
SIGNATURES_GO_TO_SIGNATURE_UNIQUE,
|
||||
trans,
|
||||
} from "translator";
|
||||
|
||||
// @ts-ignore incredible but the console.log is needed
|
||||
import * as PdfWorker from "pdfjs-dist/build/pdf.worker.mjs";
|
||||
console.log(PdfWorker); // incredible but this is needed
|
||||
console.log(PdfWorker);
|
||||
|
||||
// import { PdfWorker } from 'pdfjs-dist/build/pdf.worker.mjs'
|
||||
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
||||
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||
import {
|
||||
download_and_decrypt_doc,
|
||||
download_doc_as_pdf,
|
||||
} from "../StoredObjectButton/helpers";
|
||||
import { download_doc_as_pdf } from "../StoredObjectButton/helpers";
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
||||
|
||||
@@ -433,6 +475,16 @@ const $toast = useToast();
|
||||
|
||||
const signature = window.signature;
|
||||
|
||||
const isFirstSignatureZone = () =>
|
||||
userSignatureZone.value?.index != null
|
||||
? userSignatureZone.value.index < 1
|
||||
: false;
|
||||
|
||||
const isLastSignatureZone = () =>
|
||||
userSignatureZone.value?.index
|
||||
? userSignatureZone.value.index >= signature.zones.length - 1
|
||||
: false;
|
||||
|
||||
const setZoomLevel = async (zoomLevel: string) => {
|
||||
zoom.value = Number.parseFloat(zoomLevel);
|
||||
await resetPages();
|
||||
@@ -604,6 +656,15 @@ const turnPage = async (upOrDown: number) => {
|
||||
}
|
||||
};
|
||||
|
||||
const selectZoneInCanvas = (signatureZone: SignatureZone) => {
|
||||
page.value = signatureZone.PDFPage.index + 1;
|
||||
const canvas = getCanvas(signatureZone.PDFPage.index + 1);
|
||||
selectZone(signatureZone, canvas);
|
||||
canvas.scrollIntoView();
|
||||
};
|
||||
|
||||
const goToSignatureZoneUnique = () => selectZoneInCanvas(signature.zones[0]);
|
||||
|
||||
const turnSignature = async (upOrDown: number) => {
|
||||
let zoneIndex = userSignatureZone.value?.index ?? -1;
|
||||
if (zoneIndex < -1) {
|
||||
@@ -616,10 +677,7 @@ const turnSignature = async (upOrDown: number) => {
|
||||
}
|
||||
let currentZone = signature.zones[zoneIndex];
|
||||
if (currentZone) {
|
||||
page.value = currentZone.PDFPage.index + 1;
|
||||
const canvas = getCanvas(currentZone.PDFPage.index + 1);
|
||||
selectZone(currentZone, canvas);
|
||||
canvas.scrollIntoView();
|
||||
selectZoneInCanvas(currentZone);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -754,7 +812,7 @@ const confirmSign = () => {
|
||||
zone: userSignatureZone.value,
|
||||
};
|
||||
makeFetch("POST", url, body)
|
||||
.then((r) => {
|
||||
.then(() => {
|
||||
checkForReady();
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -776,9 +834,7 @@ const undoSign = async () => {
|
||||
};
|
||||
|
||||
const toggleAddZone = () => {
|
||||
canvasEvent.value === "select"
|
||||
? (canvasEvent.value = "add")
|
||||
: (canvasEvent.value = "select");
|
||||
canvasEvent.value = canvasEvent.value === "select" ? "add" : "select";
|
||||
};
|
||||
|
||||
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
||||
|
@@ -28,6 +28,10 @@ const open = () => {
|
||||
state.opened = true;
|
||||
};
|
||||
|
||||
const onRestoreVersion = (payload: {
|
||||
newVersion: StoredObjectVersionWithPointInTime;
|
||||
}) => emit("restoreVersion", payload);
|
||||
|
||||
defineExpose({ open });
|
||||
</script>
|
||||
<template>
|
||||
@@ -42,9 +46,7 @@ defineExpose({ open });
|
||||
:versions="props.versions"
|
||||
:can-edit="canEdit"
|
||||
:stored-object="storedObject"
|
||||
@restore-version="
|
||||
(payload) => emit('restoreVersion', payload)
|
||||
"
|
||||
@restore-version="onRestoreVersion"
|
||||
></history-button-list>
|
||||
</template>
|
||||
</modal>
|
||||
|
@@ -23,7 +23,7 @@ License * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{{ encore_entry_link_tags("mod_document_action_buttons_group") }}
|
||||
{% endblock %} {% block content %}
|
||||
|
||||
<div class="col-md-10 col-xxl">
|
||||
<div class="document-list">
|
||||
<h1>
|
||||
{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}
|
||||
</h1>
|
||||
|
@@ -3,54 +3,54 @@
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col" style="width: unset">
|
||||
{% if document.object.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.object.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<!-- person document or accompanying course document -->
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">
|
||||
{% if document.object.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.object.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if context == 'person' and accompanyingCourse is defined %}
|
||||
<div>
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
||||
</span>
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% elseif context == 'accompanying-period' and person is defined %}
|
||||
{% if document.object.type is not empty %}
|
||||
<div>
|
||||
{{ mm.mimeIcon(document.object.type) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<span class="badge bg-primary">
|
||||
{{ 'Document from person %name%'|trans({ '%name%': document.person|chill_entity_render_string }) }}
|
||||
</span>
|
||||
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.object.type is not empty %}
|
||||
<div>
|
||||
{{ mm.mimeIcon(document.object.type) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% if document.object.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="item-col">
|
||||
<div class="container">
|
||||
{% if document.date is not null %}
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.date|format_date('short') }}</span>
|
||||
{% if document.object.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if document.date is not null %}
|
||||
<div class="aside">
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.date|format_date('short') }}</span>
|
||||
</div>
|
||||
{% if context == 'person' and accompanyingCourse is defined %}
|
||||
<div class="text-end">
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
||||
</span>
|
||||
</div>
|
||||
{% elseif context == 'accompanying-period' and person is defined %}
|
||||
<div class="text-end">
|
||||
<span class="badge bg-primary">
|
||||
{{ document.person|chill_entity_render_string }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% if document.description is not empty %}
|
||||
<div class="item-row">
|
||||
|
@@ -62,7 +62,15 @@ final readonly class RemoveOldVersionMessageHandler implements MessageHandlerInt
|
||||
|
||||
$storedObject = $storedObjectVersion->getStoredObject();
|
||||
|
||||
$this->storedObjectManager->delete($storedObjectVersion);
|
||||
if ($this->storedObjectManager->exists($storedObjectVersion)) {
|
||||
$this->storedObjectManager->delete($storedObjectVersion);
|
||||
} else {
|
||||
$this->logger->notice(
|
||||
self::LOG_PREFIX.'Stored object version does not exists any more.',
|
||||
['storedObjectVersionName' => $storedObjectVersion->getFilename()],
|
||||
);
|
||||
}
|
||||
|
||||
// to ensure an immediate deletion
|
||||
$this->entityManager->remove($storedObjectVersion);
|
||||
|
||||
|
@@ -44,6 +44,7 @@ class RemoveOldVersionMessageHandlerTest extends TestCase
|
||||
$entityManager->expects($this->once())->method('clear');
|
||||
|
||||
$storedObjectManager = $this->createMock(StoredObjectManagerInterface::class);
|
||||
$storedObjectManager->expects($this->once())->method('exists')->willReturn(true);
|
||||
$storedObjectManager->expects($this->once())->method('delete')->with($this->identicalTo($version));
|
||||
|
||||
$handler = new RemoveOldVersionMessageHandler($storedObjectVersionRepository, new NullLogger(), $entityManager, $storedObjectManager, new MockClock());
|
||||
@@ -51,6 +52,29 @@ class RemoveOldVersionMessageHandlerTest extends TestCase
|
||||
$handler(new RemoveOldVersionMessage(1));
|
||||
}
|
||||
|
||||
public function testInvokeForVersionNotExisting(): void
|
||||
{
|
||||
$object = new StoredObject();
|
||||
$version = $object->registerVersion();
|
||||
$storedObjectVersionRepository = $this->createMock(StoredObjectVersionRepository::class);
|
||||
$storedObjectVersionRepository->expects($this->once())->method('find')
|
||||
->with($this->identicalTo(1))
|
||||
->willReturn($version);
|
||||
|
||||
$entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
$entityManager->expects($this->once())->method('remove')->with($this->identicalTo($version));
|
||||
$entityManager->expects($this->once())->method('flush');
|
||||
$entityManager->expects($this->once())->method('clear');
|
||||
|
||||
$storedObjectManager = $this->createMock(StoredObjectManagerInterface::class);
|
||||
$storedObjectManager->expects($this->once())->method('exists')->willReturn(false);
|
||||
$storedObjectManager->expects($this->never())->method('delete')->with($this->identicalTo($version));
|
||||
|
||||
$handler = new RemoveOldVersionMessageHandler($storedObjectVersionRepository, new NullLogger(), $entityManager, $storedObjectManager, new MockClock());
|
||||
|
||||
$handler(new RemoveOldVersionMessage(1));
|
||||
}
|
||||
|
||||
public function testInvokeWithStoredObjectToDelete(): void
|
||||
{
|
||||
$object = new StoredObject();
|
||||
@@ -123,6 +147,6 @@ class DummyStoredObjectManager implements StoredObjectManagerInterface
|
||||
|
||||
public function exists(StoredObject|StoredObjectVersion $document): bool
|
||||
{
|
||||
throw new \RuntimeException();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -99,3 +99,30 @@ CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE: Modifier un document
|
||||
entity_display_title:
|
||||
Document (n°%doc%): "Document (n°%doc%)"
|
||||
Doc for evaluation (n°%eval%): Document de l'évaluation n°%eval%
|
||||
|
||||
|
||||
# SIGNATURES
|
||||
|
||||
signatures:
|
||||
yes: Oui
|
||||
are_you_sure: Êtes-vous sûr·e?
|
||||
you_are_going_to_sign: Vous allez signer le document
|
||||
signature_confirmation: Confirmation de la signature
|
||||
sign: Signer
|
||||
choose_another_signature: Choisir une autre zone
|
||||
cancel: Annuler
|
||||
last_sign_zone: Zone de signature précédente
|
||||
next_sign_zone: Zone de signature suivante
|
||||
add_sign_zone: Ajouter une zone de signature
|
||||
click_on_document: Cliquer sur le document
|
||||
last_zone: Zone précédente
|
||||
next_zone: Zone suivante
|
||||
add_zone: Ajouter une zone
|
||||
another_zone: Autre zone
|
||||
electronic_signature_in_progress: Signature électronique en cours...
|
||||
loading: Chargement...
|
||||
remove_sign_zone: Enlever la zone
|
||||
return: Retour
|
||||
see_all_pages: Voir toutes les pages
|
||||
all_pages: Toutes les pages
|
||||
go_to_signature_unique: Aller à la zone de signature
|
||||
|
@@ -63,7 +63,6 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
parent::getSubscribedServices(),
|
||||
[
|
||||
'chill_main.paginator_factory' => PaginatorFactory::class,
|
||||
ManagerRegistry::class => ManagerRegistry::class,
|
||||
'translator' => TranslatorInterface::class,
|
||||
AuthorizationHelper::class => AuthorizationHelper::class,
|
||||
EventDispatcherInterface::class => EventDispatcherInterface::class,
|
||||
@@ -213,7 +212,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
|
||||
protected function getManagerRegistry(): ManagerRegistry
|
||||
{
|
||||
return $this->container->get(ManagerRegistry::class);
|
||||
return $this->container->get('doctrine');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +225,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
|
||||
protected function getValidator(): ValidatorInterface
|
||||
{
|
||||
return $this->get('validator');
|
||||
return $this->container->get('validator');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -75,8 +75,8 @@ final class UserGroupRepository implements UserGroupRepositoryInterface, LocaleA
|
||||
->setWhereClauses('
|
||||
ug.active AND (
|
||||
SIMILARITY(LOWER(UNACCENT(?)), ug.label->>?) > 0.15
|
||||
OR ug.label->>? LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||
', [$pattern, $lang, $pattern, $lang]);
|
||||
OR LOWER(UNACCENT(ug.label->>?)) LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||
', [$pattern, $lang, $lang, $pattern]);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
@@ -25,7 +25,34 @@ div.flex-table {
|
||||
div.item-col:last-child {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
div.item-two-col-grid {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
justify-content: stretch;
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
grid-template-areas:
|
||||
"title aside";
|
||||
grid-template-columns: 1fr minmax(8rem, 1fr);
|
||||
column-gap: 0.5em;
|
||||
}
|
||||
@include media-breakpoint-down(lg) {
|
||||
grid-template-areas:
|
||||
"aside"
|
||||
"title";
|
||||
}
|
||||
|
||||
& > div.title {
|
||||
grid-area: title;
|
||||
}
|
||||
|
||||
& > div.aside {
|
||||
grid-area: aside;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
h2, h3, h4, dl, p {
|
||||
|
@@ -12,10 +12,6 @@ function loadDynamicPicker(element) {
|
||||
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
||||
|
||||
apps.forEach(function (el) {
|
||||
let suggested;
|
||||
let as_id;
|
||||
let submit_on_adding_new_entity;
|
||||
let label;
|
||||
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
||||
uniqId = el.dataset.uniqid,
|
||||
input = element.querySelector(
|
||||
@@ -26,12 +22,12 @@ function loadDynamicPicker(element) {
|
||||
? JSON.parse(input.value)
|
||||
: input.value === "[]" || input.value === ""
|
||||
? null
|
||||
: [JSON.parse(input.value)];
|
||||
(suggested = JSON.parse(el.dataset.suggested)),
|
||||
(as_id = parseInt(el.dataset.asId) === 1),
|
||||
(submit_on_adding_new_entity =
|
||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1);
|
||||
label = el.dataset.label;
|
||||
: [JSON.parse(input.value)],
|
||||
suggested = JSON.parse(el.dataset.suggested),
|
||||
as_id = parseInt(el.dataset.asId) === 1,
|
||||
submit_on_adding_new_entity =
|
||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1,
|
||||
label = el.dataset.label;
|
||||
|
||||
if (!isMultiple) {
|
||||
if (input.value === "[]") {
|
||||
@@ -177,7 +173,7 @@ document.addEventListener("pick-entity-type-action", function (e) {
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function (e) {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
loadDynamicPicker(document);
|
||||
});
|
||||
|
||||
|
@@ -45,6 +45,10 @@ const onPickGenericDoc = ({
|
||||
}) => {
|
||||
emit("pickGenericDoc", { genericDoc });
|
||||
};
|
||||
|
||||
const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
||||
emit("removeAttachment", payload);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -56,7 +60,7 @@ const onPickGenericDoc = ({
|
||||
></pick-generic-doc-modal>
|
||||
<attachment-list
|
||||
:attachments="props.attachments"
|
||||
@removeAttachment="(payload) => emit('removeAttachment', payload)"
|
||||
@removeAttachment="onRemoveAttachment"
|
||||
></attachment-list>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
|
@@ -72,6 +72,14 @@ const placeTrans = (str: string): string => {
|
||||
}
|
||||
};
|
||||
|
||||
const onPickDocument = (payload: {
|
||||
genericDoc: GenericDocForAccompanyingPeriod;
|
||||
}) => emit("pickGenericDoc", payload);
|
||||
|
||||
const onRemoveGenericDoc = (payload: {
|
||||
genericDoc: GenericDocForAccompanyingPeriod;
|
||||
}) => emit("removeGenericDoc", payload);
|
||||
|
||||
const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
||||
if (false === loaded.value) {
|
||||
return [];
|
||||
@@ -245,10 +253,8 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
||||
:accompanying-period-id="accompanyingPeriodId"
|
||||
:genericDoc="g"
|
||||
:is-picked="isPicked(g)"
|
||||
@pickGenericDoc="(payload) => emit('pickGenericDoc', payload)"
|
||||
@removeGenericDoc="
|
||||
(payload) => emit('removeGenericDoc', payload)
|
||||
"
|
||||
@pickGenericDoc="onPickDocument"
|
||||
@removeGenericDoc="onRemoveGenericDoc"
|
||||
></pick-generic-doc-item>
|
||||
</div>
|
||||
<div v-else class="text-center chill-no-data-statement">
|
||||
|
@@ -26,9 +26,9 @@
|
||||
trans(THIRDPARTY_CONTACT_OF)
|
||||
}}</span>
|
||||
<span v-else-if="props.entity.kind === 'company'">{{
|
||||
trans(THIRDPARTY_A_CONTACT)
|
||||
trans(THIRDPARTY_A_COMPANY)
|
||||
}}</span>
|
||||
<span v-else>{{ $t("thirdparty.contact") }}</span>
|
||||
<span v-else>{{ trans(THIRDPARTY_A_CONTACT) }}</span>
|
||||
</template>
|
||||
</span>
|
||||
|
||||
@@ -54,6 +54,7 @@ import {
|
||||
ACCEPTED_USERS,
|
||||
THIRDPARTY_A_CONTACT,
|
||||
THIRDPARTY_CONTACT_OF,
|
||||
THIRDPARTY_A_COMPANY,
|
||||
PERSON,
|
||||
THIRDPARTY,
|
||||
} from "translator";
|
||||
|
@@ -136,6 +136,59 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Fix the title in the flex table</h2>
|
||||
|
||||
<p>This will fix the layout of the row, with a "title" element, and an aside element. Using <code>css grid</code>, this is quite safe and won't overflow</p>
|
||||
|
||||
<xmp>
|
||||
<div class="flex-table">
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">This is my title</div>
|
||||
<div class="aside">Aside value</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">
|
||||
<div><h3>This is my title, which can be very long and take a lot of place. But it is wrapped successfully, and won't disturb the placement of the aside block</h3></div>
|
||||
<div>This is a second line</div>
|
||||
</div>
|
||||
<div class="aside">Aside value</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xmp>
|
||||
|
||||
<p>will render:</p>
|
||||
|
||||
<div class="flex-table">
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">This is my title</div>
|
||||
<div class="aside">Aside value</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-two-col-grid">
|
||||
<div class="title">
|
||||
<div><h3>This is my title, which can be very long and take a lot of place. But it is wrapped successfully, and won't disturb the placement of the aside block</h3></div>
|
||||
<div>This is a second line</div>
|
||||
</div>
|
||||
<div class="aside">Aside value</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Wrap-list</h2>
|
||||
<p>Une liste inline qui s'aligne, puis glisse sous son titre.</p>
|
||||
<div class="wrap-list debug">
|
||||
@@ -392,4 +445,12 @@ Toutes les classes btn-* de bootstrap sont fonctionnelles
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h1>Badges</h1>
|
||||
|
||||
<span class="badge-accompanying-work-type-simple">Action d'accompagnement</span>
|
||||
<span class="badge-activity-type-simple">Type d'échange</span>
|
||||
<span class="badge-calendar-simple">Rendez-vous</span>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -34,6 +34,7 @@ class GenderDocGenNormalizer implements ContextAwareNormalizerInterface, Normali
|
||||
'id' => $gender->getId(),
|
||||
'label' => $this->translatableStringHelper->localize($gender->getLabel()),
|
||||
'genderTranslation' => $gender->getGenderTranslation(),
|
||||
'type' => 'chill_main_gender',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -68,8 +68,8 @@ class AddressReferenceBEFromBestAddress
|
||||
$csv->setDelimiter(',');
|
||||
$csv->setHeaderOffset(0);
|
||||
|
||||
$stmt = Statement::create()
|
||||
->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -55,32 +55,32 @@ class AddressReferenceFromBAN
|
||||
|
||||
$csv = Reader::createFromStream($csvDecompressed);
|
||||
$csv->setDelimiter(';')->setHeaderOffset(0);
|
||||
$stmt = Statement::create()
|
||||
->process($csv, [
|
||||
'id',
|
||||
'id_fantoir',
|
||||
'numero',
|
||||
'rep',
|
||||
'nom_voie',
|
||||
'code_postal',
|
||||
'code_insee',
|
||||
'nom_commune',
|
||||
'code_insee_ancienne_commune',
|
||||
'nom_ancienne_commune',
|
||||
'x',
|
||||
'y',
|
||||
'lon',
|
||||
'lat',
|
||||
'type_position',
|
||||
'alias',
|
||||
'nom_ld',
|
||||
'libelle_acheminement',
|
||||
'nom_afnor',
|
||||
'source_position',
|
||||
'source_nom_voie',
|
||||
'certification_commune',
|
||||
'cad_parcelles',
|
||||
]);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv, [
|
||||
'id',
|
||||
'id_fantoir',
|
||||
'numero',
|
||||
'rep',
|
||||
'nom_voie',
|
||||
'code_postal',
|
||||
'code_insee',
|
||||
'nom_commune',
|
||||
'code_insee_ancienne_commune',
|
||||
'nom_ancienne_commune',
|
||||
'x',
|
||||
'y',
|
||||
'lon',
|
||||
'lat',
|
||||
'type_position',
|
||||
'alias',
|
||||
'nom_ld',
|
||||
'libelle_acheminement',
|
||||
'nom_afnor',
|
||||
'source_position',
|
||||
'source_nom_voie',
|
||||
'certification_commune',
|
||||
'cad_parcelles',
|
||||
]);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -43,17 +43,17 @@ class AddressReferenceFromBano
|
||||
|
||||
$csv = Reader::createFromStream($file);
|
||||
$csv->setDelimiter(',');
|
||||
$stmt = Statement::create()
|
||||
->process($csv, [
|
||||
'refId',
|
||||
'streetNumber',
|
||||
'street',
|
||||
'postcode',
|
||||
'city',
|
||||
'_o',
|
||||
'lat',
|
||||
'lon',
|
||||
]);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv, [
|
||||
'refId',
|
||||
'streetNumber',
|
||||
'street',
|
||||
'postcode',
|
||||
'city',
|
||||
'_o',
|
||||
'lat',
|
||||
'lon',
|
||||
]);
|
||||
|
||||
foreach ($stmt as $record) {
|
||||
$this->baseImporter->importAddress(
|
||||
|
@@ -54,7 +54,8 @@ class AddressReferenceLU
|
||||
|
||||
private function process_address(Reader $csv, ?string $sendAddressReportToEmail = null): void
|
||||
{
|
||||
$stmt = Statement::create()->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
foreach ($stmt as $record) {
|
||||
$this->addressBaseImporter->importAddress(
|
||||
$record['id_geoportail'],
|
||||
@@ -74,7 +75,8 @@ class AddressReferenceLU
|
||||
|
||||
private function process_postal_code(Reader $csv): void
|
||||
{
|
||||
$stmt = Statement::create()->process($csv);
|
||||
$stmt = new Statement();
|
||||
$stmt = $stmt->process($csv);
|
||||
$arr_postal_codes = [];
|
||||
foreach ($stmt as $record) {
|
||||
if (false === \array_key_exists($record['code_postal'], $arr_postal_codes)) {
|
||||
|
@@ -25,6 +25,8 @@ use Symfony\Component\Workflow\Transition;
|
||||
#[AsMessageHandler]
|
||||
final readonly class CancelStaleWorkflowHandler
|
||||
{
|
||||
private const LOG_PREFIX = '[CancelStaleWorkflowHandler] ';
|
||||
|
||||
public function __construct(
|
||||
private EntityWorkflowRepository $workflowRepository,
|
||||
private Registry $registry,
|
||||
@@ -40,13 +42,13 @@ final readonly class CancelStaleWorkflowHandler
|
||||
|
||||
$workflow = $this->workflowRepository->find($message->getWorkflowId());
|
||||
if (null === $workflow) {
|
||||
$this->logger->alert('Workflow was not found!', [$workflowId]);
|
||||
$this->logger->alert(self::LOG_PREFIX.'Workflow was not found!', ['entityWorkflowId' => $workflowId]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (false === $workflow->isStaledAt($olderThanDate)) {
|
||||
$this->logger->alert('Workflow has transitioned in the meantime.', [$workflowId]);
|
||||
$this->logger->alert(self::LOG_PREFIX.'Workflow has transitioned in the meantime.', ['entityWorkflowId' => $workflowId]);
|
||||
|
||||
throw new UnrecoverableMessageHandlingException('the workflow is not staled any more');
|
||||
}
|
||||
@@ -67,14 +69,14 @@ final readonly class CancelStaleWorkflowHandler
|
||||
'transitionAt' => $this->clock->now(),
|
||||
'transition' => $transition->getName(),
|
||||
]);
|
||||
$this->logger->info('EntityWorkflow has been cancelled automatically.', [$workflowId]);
|
||||
$this->logger->info(self::LOG_PREFIX.'EntityWorkflow has been cancelled automatically.', ['entityWorkflowId' => $workflowId]);
|
||||
$transitionApplied = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$transitionApplied) {
|
||||
$this->logger->error('No valid transition found for EntityWorkflow.', [$workflowId]);
|
||||
$this->logger->error(self::LOG_PREFIX.'No valid transition found for EntityWorkflow.', ['entityWorkflowId' => $workflowId]);
|
||||
throw new UnrecoverableMessageHandlingException(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
|
||||
}
|
||||
|
||||
|
@@ -61,6 +61,7 @@ final class GenderDocGenNormalizerTest extends TestCase
|
||||
'id' => 1,
|
||||
'label' => 'homme',
|
||||
'genderTranslation' => GenderEnum::MALE,
|
||||
'type' => 'chill_main_gender',
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $this->normalizer->normalize($gender));
|
||||
|
@@ -943,6 +943,16 @@ paths:
|
||||
description: "ok"
|
||||
401:
|
||||
description: "Unauthorized"
|
||||
/1.0/main/gender.json:
|
||||
get:
|
||||
tags:
|
||||
- gender
|
||||
summary: Return all gender types
|
||||
responses:
|
||||
200:
|
||||
description: "ok"
|
||||
401:
|
||||
description: "Unauthorized"
|
||||
/1.0/main/user-job.json:
|
||||
get:
|
||||
tags:
|
||||
|
@@ -26,7 +26,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
|
||||
{
|
||||
$now = $this->clock->now();
|
||||
|
||||
if (null !== $cronJobExecution && $now->sub(new \DateInterval('P1D')) < $cronJobExecution->getLastStart()) {
|
||||
if (null !== $cronJobExecution && $now->sub(new \DateInterval('PT23H45M')) < $cronJobExecution->getLastStart()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -204,20 +204,25 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
|
||||
['date' => 'DESC', 'id' => 'DESC'],
|
||||
);
|
||||
|
||||
$activities = \array_slice($activities, 0, 3);
|
||||
|
||||
$works = $this->workRepository->findByAccompanyingPeriod(
|
||||
$accompanyingCourse,
|
||||
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
||||
3
|
||||
);
|
||||
|
||||
$counters = [
|
||||
'activities' => count($activities),
|
||||
'openWorks' => count($accompanyingCourse->getOpenWorks()),
|
||||
'works' => count($works),
|
||||
];
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||
'accompanyingCourse' => $accompanyingCourse,
|
||||
'withoutHousehold' => $withoutHousehold,
|
||||
'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(),
|
||||
'works' => $works,
|
||||
'activities' => $activities,
|
||||
'activities' => \array_slice($activities, 0, 3),
|
||||
'counters' => $counters,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -511,6 +511,14 @@ class AccompanyingPeriod implements
|
||||
return $this->getParticipationsContainsPerson($person)->count() > 0;
|
||||
}
|
||||
|
||||
public function getOpenWorks(): Collection
|
||||
{
|
||||
return $this->getWorks()->filter(
|
||||
static fn (AccompanyingPeriodWork $work): bool => null === $work->getEndDate()
|
||||
or $work->getEndDate() > new \DateTimeImmutable('today')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a new participation for a person.
|
||||
*/
|
||||
|
@@ -58,13 +58,11 @@ class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterfa
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||
private ?int $numberOfChildren = null;
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||
private ?int $numberOfDependents = null;
|
||||
|
||||
#[Assert\NotNull]
|
||||
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||
|
@@ -71,7 +71,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
->setExtras(['order' => 30]);
|
||||
*/
|
||||
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Comment'), [
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Comments'), [
|
||||
'route' => 'chill_person_accompanying_period_comment_list',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
@@ -80,12 +80,15 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
}
|
||||
|
||||
if ($this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $period)) {
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Action'), [
|
||||
$menu->addChild($this->translator->trans('Accompanying Course Actions'), [
|
||||
'route' => 'chill_person_accompanying_period_work_list',
|
||||
'routeParameters' => [
|
||||
'id' => $period->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 40]);
|
||||
->setExtras([
|
||||
'order' => 40,
|
||||
'counter' => count($period->getOpenWorks()) > 0 ? count($period->getOpenWorks()) : null,
|
||||
]);
|
||||
}
|
||||
|
||||
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
||||
|
@@ -304,5 +304,14 @@ div#dashboards {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
div.count-item {
|
||||
font-size: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
div.count-item-label {
|
||||
font-size: 90%;
|
||||
font-variant: all-small-caps;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
.badge-accompanying-work-type-simple {
|
||||
@extend .badge;
|
||||
display: inline-block;
|
||||
margin: 0.2rem 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0.5rem;
|
||||
|
||||
border-left: 20px groove $orange;
|
||||
border-radius: $badge-border-radius;
|
||||
|
||||
max-width: 100%;
|
||||
background-color: $gray-100;
|
||||
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-indent: 5px hanging;
|
||||
text-align: left;
|
||||
|
||||
&::before {
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
left: -0.5px;
|
||||
font-family: ForkAwesome;
|
||||
content: '\f04b';
|
||||
color: #e2793d;
|
||||
}
|
||||
}
|
||||
|
||||
/// AccompanyingCourse Work Pages
|
||||
div.accompanying-course-work {
|
||||
|
||||
|
@@ -33,18 +33,7 @@ const getUserJobs = () => fetchResults("/api/1.0/main/user-job.json");
|
||||
|
||||
const getSocialIssues = () => {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return fetch(url).then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
throw {
|
||||
msg: "Error while retriving Social Issues.",
|
||||
sta: response.status,
|
||||
txt: response.statusText,
|
||||
err: new Error(),
|
||||
body: response.body,
|
||||
};
|
||||
});
|
||||
return fetchResults(url);
|
||||
};
|
||||
|
||||
const whoami = () => {
|
||||
|
@@ -204,7 +204,8 @@ export default {
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch(
|
||||
|
@@ -385,7 +385,8 @@ export default {
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
if (payload.data.address) {
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
}
|
||||
|
@@ -194,6 +194,7 @@ export default {
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = payload.data.address
|
||||
? { id: payload.data.address.address_id }
|
||||
: null;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
<script>
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapGetters, mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
@@ -51,16 +51,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit("catchError", error);
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
fetchResults(`/api/1.0/person/social-work/social-issue.json`).then(
|
||||
(response) => {
|
||||
this.options = response;
|
||||
},
|
||||
);
|
||||
},
|
||||
updateSocialIssues(value) {
|
||||
this.$store
|
||||
|
@@ -6,7 +6,7 @@ import {
|
||||
} from "ChillMainAssets/chill/js/date";
|
||||
import { findSocialActionsBySocialIssue } from "ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js";
|
||||
// import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { fetchResults, makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
|
||||
const debug = process.env.NODE_ENV !== "production";
|
||||
|
||||
@@ -168,9 +168,9 @@ const store = createStore({
|
||||
},
|
||||
fetchOtherSocialIssues({ commit }) {
|
||||
const url = `/api/1.0/person/social-work/social-issue.json`;
|
||||
return makeFetch("GET", url)
|
||||
return fetchResults(url)
|
||||
.then((response) => {
|
||||
commit("updateIssuesOther", response.results);
|
||||
commit("updateIssuesOther", response); // Directly commit the array of issues
|
||||
})
|
||||
.catch((error) => {
|
||||
throw error;
|
||||
|
@@ -745,7 +745,8 @@ export default {
|
||||
let body = { type: payload.type };
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.phonenumber;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch(
|
||||
@@ -755,7 +756,9 @@ export default {
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("updateThirdParty", response);
|
||||
this.$refs.onTheFly.closeModal();
|
||||
for (let otf of this.$refs.onTheFly) {
|
||||
otf.closeModal();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
|
@@ -201,7 +201,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if accompanyingCourse.step != 'DRAFT' %}
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
<div class="mbloc col col-sm-6 col-lg-8 col-xxl-4">
|
||||
<div class="notification-counter">
|
||||
<h4 class="item-key">{{ 'notification.Notifications'|trans }}</h4>
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) %}
|
||||
@@ -238,6 +238,31 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if counters.activities > 0 %}
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
<div class="count-activities">
|
||||
<div class="count-item">{{ counters.activities }}</div>
|
||||
<div class="count-item-label">
|
||||
{% if counters.activities == 1 %}
|
||||
{{ 'Activity'|trans }}
|
||||
{% else %}
|
||||
{{ 'Activities'|trans }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if counters.works > 0 %}
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
<div class="count-works">
|
||||
<div class="count-item">{{ counters.openWorks }} / {{ counters.works }}</div>
|
||||
<div class="count-item-label">{{ 'accompanying_course_work.On-going works over total'|trans }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="social-actions my-4">
|
||||
|
@@ -5,44 +5,49 @@
|
||||
{% set w = document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork %}
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col" style="width: unset">
|
||||
{% if document.storedObject.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if context == 'person' %}
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ w.accompanyingPeriod.id }}
|
||||
</span>
|
||||
<!-- evaluation document -->
|
||||
<div class="item-two-col-grid" style="width: unset">
|
||||
<div class="title">
|
||||
{% if document.storedObject.isPending %}
|
||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<div class="badge-accompanying-work-type">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">{{ w.socialAction|chill_entity_render_string }} > {{ document.accompanyingPeriodWorkEvaluation.evaluation.title|localize_translatable_string }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.storedObject.type is not empty %}
|
||||
<div>
|
||||
{{ mm.mimeIcon(document.storedObject.type) }}
|
||||
<div>
|
||||
<div class="badge-accompanying-work-type-simple">
|
||||
{{ w.socialAction|chill_entity_render_string }} > {{ document.accompanyingPeriodWorkEvaluation.evaluation.title|localize_translatable_string }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="denomination h2">
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.storedObject.type is not empty %}
|
||||
<div>
|
||||
{{ mm.mimeIcon(document.storedObject.type) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if document.storedObject.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if document.storedObject.createdAt is not null %}
|
||||
<div class="aside">
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.storedObject.createdAt|format_date('short') }}</span>
|
||||
</div>
|
||||
{% if context == 'person' %}
|
||||
<div class="text-end">
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ w.accompanyingPeriod.id }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if document.storedObject.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="item-col">
|
||||
<div class="container">
|
||||
<div class="dates row text-end">
|
||||
<span>{{ document.storedObject.createdAt|format_date('short') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -804,7 +804,7 @@ person_admin:
|
||||
|
||||
# specific to accompanying period
|
||||
accompanying_period:
|
||||
deleted: Parcours d'accompagnment supprimé
|
||||
deleted: Parcours d'accompagnement supprimé
|
||||
dates: Période
|
||||
dates_from_%opening_date%: Ouvert depuis le %opening_date%
|
||||
dates_from_%opening_date%_to_%closing_date%: Ouvert du %opening_date% au %closing_date%
|
||||
@@ -843,6 +843,7 @@ accompanying_course:
|
||||
administrative_location: Localisation administrative
|
||||
comment is pinned: Le commentaire est épinglé
|
||||
comment is unpinned: Le commentaire est désépinglé
|
||||
|
||||
show: Montrer
|
||||
hide: Masquer
|
||||
closed periods: parcours clôturés
|
||||
@@ -851,6 +852,7 @@ Social work configuration: Gestion des actions d'accompagnement social
|
||||
|
||||
# Accompanying Course comments
|
||||
Accompanying Course Comment: Commentaire
|
||||
Accompanying Course Comments: Commentaires
|
||||
Accompanying Course Comment list: Commentaires du parcours
|
||||
pinned: épinglé
|
||||
Pin comment: Épingler
|
||||
@@ -919,6 +921,7 @@ accompanying_course_work:
|
||||
date_filter: Filtrer par date
|
||||
types_filter: Filtrer par type d'action
|
||||
user_filter: Filtrer par intervenant
|
||||
On-going works over total: Actions en cours / Actions du parcours
|
||||
|
||||
|
||||
#
|
||||
|
@@ -65,6 +65,7 @@ class ThirdpartyCSVExportController extends AbstractController
|
||||
'Name',
|
||||
'Profession',
|
||||
'Telephone',
|
||||
'Telephone2',
|
||||
'Email',
|
||||
'Address',
|
||||
'Comment',
|
||||
@@ -76,6 +77,7 @@ class ThirdpartyCSVExportController extends AbstractController
|
||||
'Contact name',
|
||||
'Contact firstname',
|
||||
'Contact phone',
|
||||
'Contact phone2',
|
||||
'Contact email',
|
||||
'Contact address',
|
||||
'Contact profession',
|
||||
|
@@ -209,6 +209,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
|
||||
#[PhonenumberConstraint(type: 'any')]
|
||||
private ?PhoneNumber $telephone = null;
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
|
||||
#[ORM\Column(name: 'telephone2', type: 'phone_number', nullable: true)]
|
||||
#[PhonenumberConstraint(type: 'any')]
|
||||
private ?PhoneNumber $telephone2 = null;
|
||||
|
||||
#[ORM\Column(name: 'types', type: \Doctrine\DBAL\Types\Types::JSON, nullable: true)]
|
||||
private ?array $thirdPartyTypes = [];
|
||||
|
||||
@@ -429,6 +434,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
|
||||
return $this->telephone;
|
||||
}
|
||||
|
||||
public function getTelephone2(): ?PhoneNumber
|
||||
{
|
||||
return $this->telephone2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type.
|
||||
*/
|
||||
@@ -712,6 +722,13 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTelephone2(?PhoneNumber $telephone2 = null): self
|
||||
{
|
||||
$this->telephone2 = $telephone2;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type.
|
||||
*
|
||||
|
@@ -59,6 +59,10 @@ class ThirdPartyType extends AbstractType
|
||||
'label' => 'Phonenumber',
|
||||
'required' => false,
|
||||
])
|
||||
->add('telephone2', ChillPhoneNumberType::class, [
|
||||
'label' => 'telephone2',
|
||||
'required' => false,
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
|
@@ -42,6 +42,7 @@ class ThirdPartyRepository implements ObjectRepository
|
||||
parent.name AS name,
|
||||
parent.profession AS profession,
|
||||
parent.telephone AS telephone,
|
||||
parent.telephone2 AS telephone2,
|
||||
parent.email AS email,
|
||||
CONCAT_WS(' ', parent_address.street, parent_address.streetnumber, parent_postal.code, parent_postal.label) AS address,
|
||||
parent.comment AS comment,
|
||||
@@ -55,6 +56,7 @@ class ThirdPartyRepository implements ObjectRepository
|
||||
contact.name AS contact_name,
|
||||
contact.firstname AS contact_firstname,
|
||||
contact.telephone AS contact_phone,
|
||||
contact.telephone2 AS contact_phone2,
|
||||
contact.email AS contact_email,
|
||||
contact.profession AS contact_profession,
|
||||
CONCAT_WS(' ', contact_address.street, contact_address.streetnumber, contact_postal.code, contact_postal.label) AS contact_address
|
||||
|
@@ -91,6 +91,18 @@
|
||||
}}</a
|
||||
>
|
||||
</li>
|
||||
<li v-if="thirdparty.telephone2">
|
||||
<i class="fa fa-li fa-mobile" />
|
||||
<a
|
||||
:href="
|
||||
'tel: ' +
|
||||
thirdparty.telephone2
|
||||
"
|
||||
>{{
|
||||
thirdparty.telephone2
|
||||
}}</a
|
||||
>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i
|
||||
class="fa fa-li fa-envelope-o"
|
||||
@@ -121,6 +133,12 @@
|
||||
thirdparty.telephone
|
||||
}}</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.telephone2">
|
||||
<i class="fa fa-li fa-mobile" />
|
||||
<a :href="'tel: ' + thirdparty.telephone2"
|
||||
>{{ thirdparty.telephone2 }}
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i class="fa fa-li fa-envelope-o" />
|
||||
<a :href="'mailto: ' + thirdparty.email">{{
|
||||
|
@@ -223,6 +223,19 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="phonenumber2"
|
||||
><i class="fa fa-fw fa-phone"
|
||||
/></span>
|
||||
<input
|
||||
class="form-control form-control-lg"
|
||||
v-model="thirdparty.telephone2"
|
||||
:placeholder="$t('thirdparty.phonenumber2')"
|
||||
:aria-label="$t('thirdparty.phonenumber2')"
|
||||
aria-describedby="phonenumber2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="parent">
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="comment"
|
||||
@@ -263,6 +276,7 @@ export default {
|
||||
firstname: "",
|
||||
name: "",
|
||||
telephone: "",
|
||||
telephone2: "",
|
||||
civility: null,
|
||||
profession: "",
|
||||
},
|
||||
@@ -368,9 +382,11 @@ export default {
|
||||
addQueryItem(field, queryItem) {
|
||||
switch (field) {
|
||||
case "name":
|
||||
this.thirdparty.name
|
||||
? (this.thirdparty.name += ` ${queryItem}`)
|
||||
: (this.thirdparty.name = queryItem);
|
||||
if (this.thirdparty.name) {
|
||||
this.thirdparty.name += ` ${queryItem}`;
|
||||
} else {
|
||||
this.thirdparty.name = queryItem;
|
||||
}
|
||||
break;
|
||||
case "firstName":
|
||||
this.thirdparty.firstname = queryItem;
|
||||
|
@@ -6,6 +6,7 @@ const thirdpartyMessages = {
|
||||
name: "Dénomination",
|
||||
email: "Courriel",
|
||||
phonenumber: "Téléphone",
|
||||
phonenumber2: "Autre numéro de téléphone",
|
||||
comment: "Commentaire",
|
||||
profession: "Qualité",
|
||||
civility: "Civilité",
|
||||
|
@@ -115,6 +115,10 @@
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
|
||||
{% endif %}
|
||||
{% if thirdparty.telephone2 is not null %}
|
||||
{% if thirdparty.telephone is not null %}, {% endif %}
|
||||
<a href="{{ 'tel:' ~ thirdparty.telephone2|phone_number_format('E164') }}">{{ thirdparty.telephone2|chill_format_phonenumber }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li><i class="fa fa-li fa-envelope-o"></i>
|
||||
<a href="{{ 'mailto:' ~ thirdparty.email }}">
|
||||
@@ -135,8 +139,14 @@
|
||||
}) }}
|
||||
</li>
|
||||
<li><i class="fa fa-li fa-phone"></i>
|
||||
{% if thirdparty.telephone %}
|
||||
<a href="{{ 'tel:' ~ thirdparty.telephone|phone_number_format('E164') }}">{{ thirdparty.telephone|chill_format_phonenumber }}</a>
|
||||
{% if thirdparty.telephone or thirdparty.telephone2 %}
|
||||
{% if thirdparty.telephone is not null %}
|
||||
<a href="{{ 'tel:' ~ thirdparty.telephone|phone_number_format('E164') }}">{{ thirdparty.telephone|chill_format_phonenumber }}</a>
|
||||
{% endif %}
|
||||
{% if thirdparty.telephone2 is not null %}
|
||||
{% if thirdparty.telephone is not null %}, {% endif %}
|
||||
<a href="{{ 'tel:' ~ thirdparty.telephone2|phone_number_format('E164') }}">{{ thirdparty.telephone2|chill_format_phonenumber }}</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
|
||||
{% endif %}
|
||||
|
@@ -22,6 +22,7 @@
|
||||
{{ form_row(form.typesAndCategories) }}
|
||||
|
||||
{{ form_row(form.telephone) }}
|
||||
{{ form_row(form.telephone2) }}
|
||||
{{ form_row(form.email) }}
|
||||
|
||||
{% if form.contactDataAnonymous is defined %}
|
||||
|
@@ -24,17 +24,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-5 mb-3">
|
||||
<div class="form-group col-md-6 mb-3">
|
||||
{{ form_widget(form.telephone) }}
|
||||
{{ form_errors(form.telephone) }}
|
||||
{{ form_label(form.telephone) }}
|
||||
</div>
|
||||
<div class="form-group col-md-5 mb-3">
|
||||
<div class="form-group col-md-6 mb-3">
|
||||
{{ form_widget(form.telephone2) }}
|
||||
{{ form_errors(form.telephone2) }}
|
||||
{{ form_label(form.telephone2) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 mb-3">
|
||||
{{ form_widget(form.email) }}
|
||||
{{ form_errors(form.email) }}
|
||||
{{ form_label(form.email) }}
|
||||
</div>
|
||||
<div class="form-group col-md-2 mb-3">
|
||||
<div class="form-group col-md-6 mb-3">
|
||||
{{ form_widget(form.contactDataAnonymous) }}
|
||||
{{ form_label(form.contactDataAnonymous) }}
|
||||
{{ form_errors(form.contactDataAnonymous) }}
|
||||
|
@@ -76,6 +76,18 @@
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
|
||||
<dt>{{ 'Phonenumber2'|trans }}</dt>
|
||||
<dd>
|
||||
{% if thirdParty.telephone2 == null %}
|
||||
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
|
||||
{% else %}
|
||||
<a href="{{ 'tel:' ~ thirdParty.telephone2|phone_number_format('E164') }}">
|
||||
{{ thirdParty.telephone2|chill_format_phonenumber }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>{{ 'email'|trans }}<dt>
|
||||
<dd>
|
||||
{% if thirdParty.email == null %}
|
||||
|
@@ -55,6 +55,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
|
||||
'profession' => $this->normalizer->normalize($thirdParty->getProfession(), $format, $context),
|
||||
'address' => $this->normalizer->normalize($thirdParty->getAddress(), $format, ['address_rendering' => 'short']),
|
||||
'telephone' => $this->normalizer->normalize($thirdParty->getTelephone(), $format, $context),
|
||||
'telephone2' => $this->normalizer->normalize($thirdParty->getTelephone2(), $format, $context),
|
||||
'email' => $thirdParty->getEmail(),
|
||||
'isChild' => $thirdParty->isChild(),
|
||||
'parent' => $this->normalizer->normalize($thirdParty->getParent(), $format, $context),
|
||||
|
@@ -28,6 +28,8 @@ components:
|
||||
type: string
|
||||
telephone:
|
||||
type: string
|
||||
telephone2:
|
||||
type: string
|
||||
address:
|
||||
$ref: "#/components/schemas/Address"
|
||||
Address:
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\Migrations\ThirdParty;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20250325085950 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add a second telephone number to ThirdParty';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_3party.third_party ADD telephone2 VARCHAR(35) DEFAULT NULL');
|
||||
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.telephone2 IS \'(DC2Type:phone_number)\'');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_3party.third_party DROP telephone2');
|
||||
}
|
||||
}
|
@@ -4,6 +4,7 @@ third parties: tiers
|
||||
firstname: Prénom
|
||||
name: Nom
|
||||
telephone: Téléphone
|
||||
telephone2: Autre numéro de téléphone
|
||||
adress: Adresse
|
||||
email: Courriel
|
||||
comment: Commentaire
|
||||
@@ -39,7 +40,7 @@ thirdparty.A contact: Une personne physique
|
||||
thirdparty.contact: Personne physique
|
||||
thirdparty.Contact of: Contact de
|
||||
thirdparty.a_company_explanation: >-
|
||||
Les personnes morales peuvent compter un ou plusieurs contacts, interne à l'instution. Il est également possible de
|
||||
Les personnes morales peuvent compter un ou plusieurs contacts, interne à l'institution. Il est également possible de
|
||||
leur associer un acronyme, et le nom d'un service.
|
||||
thirdparty.a_contact_explanation: >-
|
||||
Les personnes physiques ne disposent pas d'acronyme, de service, ou de contacts sous-jacents. Il est possible de leur
|
||||
@@ -149,6 +150,8 @@ Contact id: Identifiant du contact
|
||||
Contact name: Nom du contact
|
||||
Contact firstname: Prénom du contact
|
||||
Contact phone: Téléphone du contact
|
||||
Contact phone2: Autre téléphone du contact
|
||||
Telephone2: Autre téléphone
|
||||
Contact email: Courrier électronique du contact
|
||||
Contact address: Adresse du contact
|
||||
Contact profession: Profession du contact
|
||||
|
Reference in New Issue
Block a user