mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-01 21:47:44 +00:00
Merge branch 'refs/heads/master' into 321-text-editor
# Conflicts: # src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/editor_config.ts # src/Bundle/ChillMainBundle/Resources/public/module/ckeditor5/index.ts # src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue # src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue # src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue # src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue # src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/MemberDetails.vue # src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/PersonComment.vue # yarn.lock
This commit is contained in:
commit
b5c9e65986
6
.changes/unreleased/DX-20250430-144550.yaml
Normal file
6
.changes/unreleased/DX-20250430-144550.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: DX
|
||||||
|
body: Remove dead code for wopi-link module
|
||||||
|
time: 2025-04-30T14:45:50.406111606+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "352"
|
||||||
|
SchemaChange: No schema change
|
7
.changes/unreleased/Feature-20250424-142211.yaml
Normal file
7
.changes/unreleased/Feature-20250424-142211.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Add the document file name to the document title when a user upload a document,
|
||||||
|
unless there is already a document title.
|
||||||
|
time: 2025-04-24T14:22:11.800975422+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "377"
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/Feature-20250520-095628.yaml
Normal file
6
.changes/unreleased/Feature-20250520-095628.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Add desactivation date for social action and issue csv export
|
||||||
|
time: 2025-05-20T09:56:28.108941934+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
7
.changes/unreleased/Fixed-20250424-133943.yaml
Normal file
7
.changes/unreleased/Fixed-20250424-133943.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: trying to prevent bug of typeerror in doc-history + improved display of document
|
||||||
|
history
|
||||||
|
time: 2025-04-24T13:39:43.878468232+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "376"
|
||||||
|
SchemaChange: No schema change
|
7
.changes/unreleased/Fixed-20250424-163746.yaml
Normal file
7
.changes/unreleased/Fixed-20250424-163746.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Display previous participation in acc course work even if the person has left
|
||||||
|
the acc course
|
||||||
|
time: 2025-04-24T16:37:46.970203594+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "381"
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/Fixed-20250505-102715.yaml
Normal file
6
.changes/unreleased/Fixed-20250505-102715.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Fix display of text in calendar events
|
||||||
|
time: 2025-05-05T10:27:15.461493066+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "372"
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/Fixed-20250514-145339.yaml
Normal file
6
.changes/unreleased/Fixed-20250514-145339.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Add missing translation for user_group.no_user_groups
|
||||||
|
time: 2025-05-14T14:53:39.53927329+02:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
6
.changes/unreleased/UX-20250423-172624.yaml
Normal file
6
.changes/unreleased/UX-20250423-172624.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: UX
|
||||||
|
body: Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
|
||||||
|
time: 2025-04-23T17:26:24.45777387+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "374"
|
||||||
|
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
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,6 +12,8 @@ docker/rabbitmq/data
|
|||||||
|
|
||||||
# in this development bundle, we want to ignore directories related to a real app
|
# in this development bundle, we want to ignore directories related to a real app
|
||||||
assets/*
|
assets/*
|
||||||
|
!assets/translator.ts
|
||||||
|
!assets/ux-translator
|
||||||
migrations/*
|
migrations/*
|
||||||
templates/*
|
templates/*
|
||||||
translations/*
|
translations/*
|
||||||
|
@ -113,7 +113,7 @@ lint:
|
|||||||
- export PATH="./node_modules/.bin:$PATH"
|
- export PATH="./node_modules/.bin:$PATH"
|
||||||
script:
|
script:
|
||||||
- yarn install --ignore-optional
|
- yarn install --ignore-optional
|
||||||
- npx eslint-baseline "**/*.{js,vue}"
|
- npx eslint-baseline "src/**/*.{js,ts,vue}"
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
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).
|
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
|
## v3.8.2 - 2025-02-10
|
||||||
### Fixed
|
### 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
|
* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal
|
||||||
|
7
assets/translator.ts
Normal file
7
assets/translator.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { trans, setLocale, setLocaleFallbacks } from "./ux-translator";
|
||||||
|
|
||||||
|
setLocaleFallbacks({"en": "fr", "nl": "fr", "fr": "en"});
|
||||||
|
setLocale('fr');
|
||||||
|
|
||||||
|
export { trans };
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
}
|
@ -75,6 +75,7 @@
|
|||||||
"symfony/templating": "^5.4",
|
"symfony/templating": "^5.4",
|
||||||
"symfony/translation": "^5.4",
|
"symfony/translation": "^5.4",
|
||||||
"symfony/twig-bundle": "^5.4",
|
"symfony/twig-bundle": "^5.4",
|
||||||
|
"symfony/ux-translator": "^2.22",
|
||||||
"symfony/validator": "^5.4",
|
"symfony/validator": "^5.4",
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "^5.4",
|
"symfony/workflow": "^5.4",
|
||||||
|
@ -36,4 +36,5 @@ return [
|
|||||||
Chill\BudgetBundle\ChillBudgetBundle::class => ['all' => true],
|
Chill\BudgetBundle\ChillBudgetBundle::class => ['all' => true],
|
||||||
Chill\WopiBundle\ChillWopiBundle::class => ['all' => true],
|
Chill\WopiBundle\ChillWopiBundle::class => ['all' => true],
|
||||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||||
|
Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true],
|
||||||
];
|
];
|
||||||
|
3
config/packages/ux_translator.yaml
Normal file
3
config/packages/ux_translator.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ux_translator:
|
||||||
|
# The directory where the JavaScript translations are dumped
|
||||||
|
dump_directory: '%kernel.project_dir%/var/translations'
|
@ -220,6 +220,7 @@ framework:
|
|||||||
- attenteModification
|
- attenteModification
|
||||||
- attenteMiseEnForme
|
- attenteMiseEnForme
|
||||||
- attenteValidationMiseEnForme
|
- attenteValidationMiseEnForme
|
||||||
|
- attenteSignature
|
||||||
- attenteVisa
|
- attenteVisa
|
||||||
- postSignature
|
- postSignature
|
||||||
- attenteTraitement
|
- attenteTraitement
|
||||||
|
@ -29,8 +29,7 @@ We strongly encourage you to initialize a git repository at this step, to track
|
|||||||
# add the flex endpoints required for custom recipes
|
# add the flex endpoints required for custom recipes
|
||||||
cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json
|
cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json
|
||||||
# install chill and some dependencies
|
# install chill and some dependencies
|
||||||
# TODO fix the suffix "alpha1" and replace by ^3.0.0 when version 3.0.0 will be released
|
symfony composer require chill-project/chill-bundles ^3.7.1 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev symfony/amqp-messenger
|
||||||
symfony composer require chill-project/chill-bundles v3.0.0-RC3 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev
|
|
||||||
|
|
||||||
We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database.
|
We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database.
|
||||||
You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually).
|
You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually).
|
||||||
@ -48,7 +47,7 @@ You must also accept to configure recipes from the contrib repository, unless yo
|
|||||||
|
|
||||||
If you encounter this error during assets compilation (:code:`yarn run encore production`) (repeated multiple times):
|
If you encounter this error during assets compilation (:code:`yarn run encore production`) (repeated multiple times):
|
||||||
|
|
||||||
.. code-block:: txt
|
.. code-block::
|
||||||
|
|
||||||
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
|
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
|
||||||
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
|
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
|
||||||
@ -74,14 +73,22 @@ or in the :code:`.env.local` file, which should not be committed to the git repo
|
|||||||
You do not need to set variables for the smtp server, redis server and relatorio server, as they are generated automatically
|
You do not need to set variables for the smtp server, redis server and relatorio server, as they are generated automatically
|
||||||
by the symfony server, from the docker compose services.
|
by the symfony server, from the docker compose services.
|
||||||
|
|
||||||
The only required variable is the :code:`ADMIN_PASSWORD`. You can generate a hashed and salted admin password using the command
|
The required variables are:
|
||||||
:code:`symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'`. Then,
|
|
||||||
|
- the :code:`ADMIN_PASSWORD`;
|
||||||
|
- the :code:`OVHCLOUD_DSN` variable;
|
||||||
|
|
||||||
|
:code:`ADMIN_PASSWORD`
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
You can generate a hashed and salted admin password using the command
|
||||||
|
:code:`symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'`.Then,
|
||||||
you can either:
|
you can either:
|
||||||
|
|
||||||
- add this password to the :code:`.env.local` file, you must escape the character :code:`$`: if the generated password
|
- add this password to the :code:`.env.local` file, you must escape the character :code:`$`: if the generated password
|
||||||
is :code:`$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your :code:`.env.local` file will be:
|
is :code:`$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your :code:`.env.local` file will be:
|
||||||
|
|
||||||
.. code-block:: env
|
.. code-block:: bash
|
||||||
|
|
||||||
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
|
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
|
||||||
# note: if you copy-paste the line above, the password will be "admin".
|
# note: if you copy-paste the line above, the password will be "admin".
|
||||||
@ -89,12 +96,24 @@ you can either:
|
|||||||
- add the generated password to the secrets manager (**note**: you must add the generated hashed password to the secrets env,
|
- add the generated password to the secrets manager (**note**: you must add the generated hashed password to the secrets env,
|
||||||
not the password in clear text).
|
not the password in clear text).
|
||||||
|
|
||||||
- set up the jwt authentication bundle
|
:code:`OVHCLOUD_DSN` and sending SMS messages
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
This is a temporary dependency, for ensuring compatibility for previous behaviour.
|
||||||
|
|
||||||
|
You can set it to :code:`null://null` if you do not plan to use sending SMS.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
OVHCLOUD_DSN=null://null
|
||||||
|
|
||||||
|
If you plan to do it, you can configure the notifier component `as described in the symfony documentation <https://symfony.com/doc/current/notifier.html#notifier-sms-channel>`_.
|
||||||
|
|
||||||
|
|
||||||
Some environment variables are available for the JWT authentication bundle in the :code:`.env` file.
|
Some environment variables are available for the JWT authentication bundle in the :code:`.env` file.
|
||||||
|
|
||||||
Prepare migrations and other tools
|
Prepare database, messenger queue, and other configuration
|
||||||
----------------------------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
To continue the installation process, you will have to run migrations:
|
To continue the installation process, you will have to run migrations:
|
||||||
|
|
||||||
@ -109,17 +128,22 @@ To continue the installation process, you will have to run migrations:
|
|||||||
symfony console messenger:setup-transports
|
symfony console messenger:setup-transports
|
||||||
# prepare some views
|
# prepare some views
|
||||||
symfony console chill:db:sync-views
|
symfony console chill:db:sync-views
|
||||||
|
# load languages data
|
||||||
|
symfony console chill:main:languages:populate
|
||||||
# generate jwt token, required for some api features (webdav access, ...)
|
# generate jwt token, required for some api features (webdav access, ...)
|
||||||
symfony console lexik:jwt:generate-keypair
|
symfony console lexik:jwt:generate-keypair
|
||||||
|
|
||||||
.. warning::
|
.. note::
|
||||||
|
|
||||||
If you encounter an error while running :code:`symfony console messenger:setup-transports`, you can set up the messenger
|
If you encounter this error:
|
||||||
transport to redis, by adding this in the :code:`.env.local` or :code:`.env` file:
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
No transport supports the given Messenger DSN.
|
||||||
|
|
||||||
|
Please check that you installed the package `symfony/amqp-messenger`.
|
||||||
|
|
||||||
.. code-block:: env
|
|
||||||
|
|
||||||
MESSENGER_TRANSPORT_DSN=redis://${REDIS_HOST}:${REDIS_PORT}/messages
|
|
||||||
|
|
||||||
Start your web server locally
|
Start your web server locally
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
@ -41,16 +41,18 @@ Postal code are loaded from this database. There is no need to load postal codes
|
|||||||
The data are prepared for Chill (`See this repository <https://gitea.champs-libres.be/Chill-project/belgian-bestaddresses-transform/releases>`_).
|
The data are prepared for Chill (`See this repository <https://gitea.champs-libres.be/Chill-project/belgian-bestaddresses-transform/releases>`_).
|
||||||
One can select postal code by his first number (:code:`1xxx` for postal codes from 1000 to 1999), or a limited list for development purpose.
|
One can select postal code by his first number (:code:`1xxx` for postal codes from 1000 to 1999), or a limited list for development purpose.
|
||||||
|
|
||||||
|
The command expects a language code as first argument.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# load postal code from 1000 to 3999:
|
# load postal code from 1000 to 3999:
|
||||||
bin/console chill:main:address-ref-from-best-addresse 1xxx 2xxx 3xxx
|
bin/console chill:main:address-ref-from-best-addresse fr 1xxx 2xxx 3xxx
|
||||||
|
|
||||||
# load only an extract (for dev purposes)
|
# load only an extract (for dev purposes)
|
||||||
bin/console chill:main:address-ref-from-best-addresse extract
|
bin/console chill:main:address-ref-from-best-addresse fr extract
|
||||||
|
|
||||||
# load full addresses (discouraged)
|
# load full addresses (discouraged)
|
||||||
bin/console chill:main:address-ref-from-best-addresse full
|
bin/console chill:main:address-ref-from-best-addresse fr full
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ export default ts.config(
|
|||||||
// override/add rules settings here, such as:
|
// override/add rules settings here, such as:
|
||||||
"vue/multi-word-component-names": "off",
|
"vue/multi-word-component-names": "off",
|
||||||
"@typescript-eslint/no-require-imports": "off",
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
|
"@typescript-eslint/ban-ts-comment": "off"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
||||||
"@eslint/js": "^9.14.0",
|
"@eslint/js": "^9.14.0",
|
||||||
|
"@hotwired/stimulus": "^3.0.0",
|
||||||
"@luminateone/eslint-baseline": "^1.0.9",
|
"@luminateone/eslint-baseline": "^1.0.9",
|
||||||
|
"@symfony/stimulus-bridge": "^3.2.0",
|
||||||
|
"@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets",
|
||||||
"@symfony/webpack-encore": "^4.1.0",
|
"@symfony/webpack-encore": "^4.1.0",
|
||||||
"@tsconfig/node20": "^20.1.4",
|
"@tsconfig/node20": "^20.1.4",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
@ -24,6 +27,7 @@
|
|||||||
"eslint-plugin-prettier": "^5.2.1",
|
"eslint-plugin-prettier": "^5.2.1",
|
||||||
"eslint-plugin-vue": "^9.30.0",
|
"eslint-plugin-vue": "^9.30.0",
|
||||||
"fork-awesome": "^1.1.7",
|
"fork-awesome": "^1.1.7",
|
||||||
|
"intl-messageformat": "^10.5.11",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"node-sass": "^8.0.0",
|
"node-sass": "^8.0.0",
|
||||||
"popper.js": "^1.16.1",
|
"popper.js": "^1.16.1",
|
||||||
@ -49,11 +53,13 @@
|
|||||||
"@fullcalendar/timegrid": "^6.1.4",
|
"@fullcalendar/timegrid": "^6.1.4",
|
||||||
"@fullcalendar/vue3": "^6.1.4",
|
"@fullcalendar/vue3": "^6.1.4",
|
||||||
"@popperjs/core": "^2.9.2",
|
"@popperjs/core": "^2.9.2",
|
||||||
|
"@tsconfig/node20": "^20.1.4",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/leaflet": "^1.9.3",
|
"@types/leaflet": "^1.9.3",
|
||||||
"bootstrap-icons": "^1.11.3",
|
"bootstrap-icons": "^1.11.3",
|
||||||
"dropzone": "^5.7.6",
|
"dropzone": "^5.7.6",
|
||||||
"es6-promise": "^4.2.8",
|
"es6-promise": "^4.2.8",
|
||||||
|
"intl-messageformat": "^10.5.11",
|
||||||
"leaflet": "^1.7.1",
|
"leaflet": "^1.7.1",
|
||||||
"marked": "^12.0.2",
|
"marked": "^12.0.2",
|
||||||
"masonry-layout": "^4.2.2",
|
"masonry-layout": "^4.2.2",
|
||||||
@ -67,7 +73,7 @@
|
|||||||
"vuex": "^4.0.0"
|
"vuex": "^4.0.0"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"Firefox ESR"
|
"defaults and fully supports es6-module and not dead"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev-server": "encore dev-server",
|
"dev-server": "encore dev-server",
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Menu;
|
namespace Chill\ActivityBundle\Menu;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
@ -23,22 +24,30 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
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)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
|
$activities = $this->managerRegistry->getManager()->getRepository(Activity::class)->findBy(
|
||||||
|
['accompanyingPeriod' => $period]
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
||||||
) {
|
) {
|
||||||
$menu->addChild($this->translator->trans('Activity'), [
|
$menu->addChild($this->translator->trans('Activities'), [
|
||||||
'route' => 'chill_activity_activity_list',
|
'route' => 'chill_activity_activity_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $period->getId(),
|
'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;
|
namespace Chill\ActivityBundle\Menu;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
@ -23,13 +24,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
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)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
||||||
$person = $parameters['person'];
|
$person = $parameters['person'];
|
||||||
|
|
||||||
|
|
||||||
|
$count = $this->activityACLAwareRepository->countByPerson($person, ActivityVoter::SEE);
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
||||||
$menu->addChild(
|
$menu->addChild(
|
||||||
$this->translator->trans('Activities'),
|
$this->translator->trans('Activities'),
|
||||||
@ -38,7 +46,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'routeParameters' => ['person_id' => $person->getId()],
|
'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;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -30,13 +30,14 @@
|
|||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li class="add-persons">
|
<li class="add-persons">
|
||||||
<add-persons
|
<add-persons
|
||||||
button-title="activity.add_persons"
|
:buttonTitle="trans(ACTIVITY_ADD_PERSONS)"
|
||||||
modal-title="activity.add_persons"
|
:modalTitle="trans(ACTIVITY_ADD_PERSONS)"
|
||||||
:key="addPersons.key"
|
v-bind:key="addPersons.key"
|
||||||
:options="addPersonsOptions"
|
v-bind:options="addPersonsOptions"
|
||||||
@add-new-persons="addNewPersons"
|
@addNewPersons="addNewPersons"
|
||||||
ref="addPersons"
|
ref="addPersons"
|
||||||
/>
|
>
|
||||||
|
</add-persons>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</teleport>
|
</teleport>
|
||||||
@ -47,6 +48,14 @@ import { mapState, mapGetters } from "vuex";
|
|||||||
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||||
import PersonsBloc from "./ConcernedGroups/PersonsBloc.vue";
|
import PersonsBloc from "./ConcernedGroups/PersonsBloc.vue";
|
||||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||||
|
import {
|
||||||
|
ACTIVITY_BLOC_PERSONS,
|
||||||
|
ACTIVITY_BLOC_PERSONS_ASSOCIATED,
|
||||||
|
ACTIVITY_BLOC_THIRDPARTY,
|
||||||
|
ACTIVITY_BLOC_USERS,
|
||||||
|
ACTIVITY_ADD_PERSONS,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ConcernedGroups",
|
name: "ConcernedGroups",
|
||||||
@ -55,18 +64,24 @@ export default {
|
|||||||
PersonsBloc,
|
PersonsBloc,
|
||||||
PersonText,
|
PersonText,
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
trans,
|
||||||
|
ACTIVITY_ADD_PERSONS,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
personsBlocs: [
|
personsBlocs: [
|
||||||
{
|
{
|
||||||
key: "persons",
|
key: "persons",
|
||||||
title: "activity.bloc_persons",
|
title: trans(ACTIVITY_BLOC_PERSONS),
|
||||||
persons: [],
|
persons: [],
|
||||||
included: false,
|
included: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "personsAssociated",
|
key: "personsAssociated",
|
||||||
title: "activity.bloc_persons_associated",
|
title: trans(ACTIVITY_BLOC_PERSONS_ASSOCIATED),
|
||||||
persons: [],
|
persons: [],
|
||||||
included: window.activity
|
included: window.activity
|
||||||
? window.activity.activityType.personsVisible !== 0
|
? window.activity.activityType.personsVisible !== 0
|
||||||
@ -82,7 +97,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "thirdparty",
|
key: "thirdparty",
|
||||||
title: "activity.bloc_thirdparty",
|
title: trans(ACTIVITY_BLOC_THIRDPARTY),
|
||||||
persons: [],
|
persons: [],
|
||||||
included: window.activity
|
included: window.activity
|
||||||
? window.activity.activityType.thirdPartiesVisible !== 0
|
? window.activity.activityType.thirdPartiesVisible !== 0
|
||||||
@ -90,7 +105,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "users",
|
key: "users",
|
||||||
title: "activity.bloc_users",
|
title: trans(ACTIVITY_BLOC_USERS),
|
||||||
persons: [],
|
persons: [],
|
||||||
included: window.activity
|
included: window.activity
|
||||||
? window.activity.activityType.usersVisible !== 0
|
? window.activity.activityType.usersVisible !== 0
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<teleport to="#location">
|
<teleport to="#location">
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<label :class="locationClassList">
|
<label :class="locationClassList">
|
||||||
{{ $t("activity.location") }}
|
{{ trans(ACTIVITY_LOCATION) }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
@ -13,17 +13,17 @@
|
|||||||
open-direction="top"
|
open-direction="top"
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
:searchable="true"
|
:searchable="true"
|
||||||
:placeholder="$t('activity.choose_location')"
|
:placeholder="trans(ACTIVITY_CHOOSE_LOCATION)"
|
||||||
:custom-label="customLabel"
|
:custom-label="customLabel"
|
||||||
:select-label="$t('multiselect.select_label')"
|
:select-label="trans(MULTISELECT_SELECT_LABEL)"
|
||||||
:deselect-label="$t('multiselect.deselect_label')"
|
:deselect-label="trans(MULTISELECT_DESELECT_LABEL)"
|
||||||
:selected-label="$t('multiselect.selected_label')"
|
:selected-label="trans(MULTISELECT_SELECTED_LABEL)"
|
||||||
:options="availableLocations"
|
:options="availableLocations"
|
||||||
group-values="locations"
|
group-values="locations"
|
||||||
group-label="locationGroup"
|
group-label="locationGroup"
|
||||||
v-model="location"
|
v-model="location"
|
||||||
/>
|
/>
|
||||||
<new-location :available-locations="availableLocations" />
|
<new-location v-bind:available-locations="availableLocations" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</teleport>
|
</teleport>
|
||||||
@ -33,6 +33,14 @@
|
|||||||
import { mapState, mapGetters } from "vuex";
|
import { mapState, mapGetters } from "vuex";
|
||||||
import VueMultiselect from "vue-multiselect";
|
import VueMultiselect from "vue-multiselect";
|
||||||
import NewLocation from "./Location/NewLocation.vue";
|
import NewLocation from "./Location/NewLocation.vue";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
ACTIVITY_LOCATION,
|
||||||
|
ACTIVITY_CHOOSE_LOCATION,
|
||||||
|
MULTISELECT_SELECT_LABEL,
|
||||||
|
MULTISELECT_DESELECT_LABEL,
|
||||||
|
MULTISELECT_SELECTED_LABEL,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Location",
|
name: "Location",
|
||||||
@ -40,6 +48,16 @@ export default {
|
|||||||
NewLocation,
|
NewLocation,
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
trans,
|
||||||
|
ACTIVITY_LOCATION,
|
||||||
|
ACTIVITY_CHOOSE_LOCATION,
|
||||||
|
MULTISELECT_SELECT_LABEL,
|
||||||
|
MULTISELECT_DESELECT_LABEL,
|
||||||
|
MULTISELECT_SELECTED_LABEL,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
locationClassList: `col-form-label col-sm-4 ${document.querySelector("input#chill_activitybundle_activity_location").getAttribute("required") ? "required" : ""}`,
|
locationClassList: `col-form-label col-sm-4 ${document.querySelector("input#chill_activitybundle_activity_location").getAttribute("required") ? "required" : ""}`,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-sm btn-create" @click="openModal">
|
<a class="btn btn-sm btn-create" @click="openModal">
|
||||||
{{ $t("activity.create_new_location") }}
|
{{ trans(ACTIVITY_CREATE_NEW_LOCATION) }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -11,12 +11,12 @@
|
|||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
<modal
|
<modal
|
||||||
v-if="modal.showModal"
|
v-if="modal.showModal"
|
||||||
:modal-dialog-class="modal.modalDialogClass"
|
:modalDialogClass="modal.modalDialogClass"
|
||||||
@close="modal.showModal = false"
|
@close="modal.showModal = false"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<h3 class="modal-title">
|
<h3 class="modal-title">
|
||||||
{{ $t("activity.create_new_location") }}
|
{{ trans(ACTIVITY_CREATE_NEW_LOCATION) }}
|
||||||
</h3>
|
</h3>
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
v-model="selectType"
|
v-model="selectType"
|
||||||
>
|
>
|
||||||
<option selected disabled value="">
|
<option selected disabled value="">
|
||||||
{{ $t("activity.choose_location_type") }}
|
{{ trans(ACTIVITY_CHOOSE_LOCATION_TYPE) }}
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
v-for="t in locationTypes"
|
v-for="t in locationTypes"
|
||||||
@ -48,7 +48,7 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<label>{{
|
<label>{{
|
||||||
$t("activity.location_fields.type")
|
trans(ACTIVITY_LOCATION_FIELDS_TYPE)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -60,14 +60,14 @@
|
|||||||
placeholder
|
placeholder
|
||||||
/>
|
/>
|
||||||
<label for="name">{{
|
<label for="name">{{
|
||||||
$t("activity.location_fields.name")
|
trans(ACTIVITY_LOCATION_FIELDS_NAME)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-address
|
<add-address
|
||||||
:context="addAddress.context"
|
:context="addAddress.context"
|
||||||
:options="addAddress.options"
|
:options="addAddress.options"
|
||||||
:address-changed-callback="submitNewAddress"
|
:addressChangedCallback="submitNewAddress"
|
||||||
v-if="showAddAddress"
|
v-if="showAddAddress"
|
||||||
ref="addAddress"
|
ref="addAddress"
|
||||||
/>
|
/>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
placeholder
|
placeholder
|
||||||
/>
|
/>
|
||||||
<label for="phonenumber1">{{
|
<label for="phonenumber1">{{
|
||||||
$t("activity.location_fields.phonenumber1")
|
trans(ACTIVITY_LOCATION_FIELDS_PHONENUMBER1)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating mb-3" v-if="hasPhonenumber1">
|
<div class="form-floating mb-3" v-if="hasPhonenumber1">
|
||||||
@ -91,7 +91,7 @@
|
|||||||
placeholder
|
placeholder
|
||||||
/>
|
/>
|
||||||
<label for="phonenumber2">{{
|
<label for="phonenumber2">{{
|
||||||
$t("activity.location_fields.phonenumber2")
|
trans(ACTIVITY_LOCATION_FIELDS_PHONENUMBER2)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating mb-3" v-if="showContactData">
|
<div class="form-floating mb-3" v-if="showContactData">
|
||||||
@ -102,7 +102,7 @@
|
|||||||
placeholder
|
placeholder
|
||||||
/>
|
/>
|
||||||
<label for="email">{{
|
<label for="email">{{
|
||||||
$t("activity.location_fields.email")
|
trans(ACTIVITY_LOCATION_FIELDS_EMAIL)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
class="btn btn-save"
|
class="btn btn-save"
|
||||||
@click.prevent="saveNewLocation"
|
@click.prevent="saveNewLocation"
|
||||||
>
|
>
|
||||||
{{ $t("action.save") }}
|
{{ trans(SAVE) }}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
@ -126,6 +126,17 @@ import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue"
|
|||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
import { getLocationTypes } from "../../api";
|
import { getLocationTypes } from "../../api";
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||||
|
import {
|
||||||
|
SAVE,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_EMAIL,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_PHONENUMBER1,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_PHONENUMBER2,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_NAME,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_TYPE,
|
||||||
|
ACTIVITY_CHOOSE_LOCATION_TYPE,
|
||||||
|
ACTIVITY_CREATE_NEW_LOCATION,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "NewLocation",
|
name: "NewLocation",
|
||||||
@ -133,6 +144,19 @@ export default {
|
|||||||
Modal,
|
Modal,
|
||||||
AddAddress,
|
AddAddress,
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
trans,
|
||||||
|
SAVE,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_EMAIL,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_PHONENUMBER1,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_PHONENUMBER2,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_NAME,
|
||||||
|
ACTIVITY_LOCATION_FIELDS_TYPE,
|
||||||
|
ACTIVITY_CHOOSE_LOCATION_TYPE,
|
||||||
|
ACTIVITY_CREATE_NEW_LOCATION,
|
||||||
|
};
|
||||||
|
},
|
||||||
props: ["availableLocations"],
|
props: ["availableLocations"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label :class="socialIssuesClassList">{{
|
<label :class="socialIssuesClassList">{{
|
||||||
$t("activity.social_issues")
|
trans(ACTIVITY_SOCIAL_ISSUES)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
@ -12,8 +12,9 @@
|
|||||||
:key="issue.id"
|
:key="issue.id"
|
||||||
:issue="issue"
|
:issue="issue"
|
||||||
:selection="socialIssuesSelected"
|
:selection="socialIssuesSelected"
|
||||||
@update-selected="updateIssuesSelected"
|
@updateSelected="updateIssuesSelected"
|
||||||
/>
|
>
|
||||||
|
</check-social-issue>
|
||||||
|
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
@ -31,10 +32,11 @@
|
|||||||
:allow-empty="true"
|
:allow-empty="true"
|
||||||
:show-labels="false"
|
:show-labels="false"
|
||||||
:loading="issueIsLoading"
|
:loading="issueIsLoading"
|
||||||
:placeholder="$t('activity.choose_other_social_issue')"
|
:placeholder="trans(ACTIVITY_CHOOSE_OTHER_SOCIAL_ISSUE)"
|
||||||
:options="socialIssuesOther"
|
:options="socialIssuesOther"
|
||||||
@select="addIssueInList"
|
@select="addIssueInList"
|
||||||
/>
|
>
|
||||||
|
</VueMultiselect>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -42,35 +44,46 @@
|
|||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label :class="socialActionsClassList">{{
|
<label :class="socialActionsClassList">{{
|
||||||
$t("activity.social_actions")
|
trans(ACTIVITY_SOCIAL_ACTIONS)
|
||||||
}}</label>
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div v-if="actionIsLoading === true">
|
<div v-if="actionIsLoading === true">
|
||||||
<i class="chill-green fa fa-circle-o-notch fa-spin fa-lg" />
|
<i
|
||||||
|
class="chill-green fa fa-circle-o-notch fa-spin fa-lg"
|
||||||
|
></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-else-if="socialIssuesSelected.length === 0"
|
v-else-if="socialIssuesSelected.length === 0"
|
||||||
class="inline-choice chill-no-data-statement mt-3"
|
class="inline-choice chill-no-data-statement mt-3"
|
||||||
>
|
>
|
||||||
{{ $t("activity.select_first_a_social_issue") }}
|
{{ trans(ACTIVITY_SELECT_FIRST_A_SOCIAL_ISSUE) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<template v-else-if="socialActionsList.length > 0">
|
<template
|
||||||
|
v-else-if="
|
||||||
|
socialActionsList.length > 0 &&
|
||||||
|
(socialIssuesSelected.length ||
|
||||||
|
socialActionsSelected.length)
|
||||||
|
"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
v-if="
|
id="actionsList"
|
||||||
socialIssuesSelected.length ||
|
v-for="group in socialActionsList"
|
||||||
socialActionsSelected.length
|
:key="group.issue"
|
||||||
"
|
|
||||||
>
|
>
|
||||||
|
<span class="badge bg-chill-l-gray text-dark">{{
|
||||||
|
group.issue
|
||||||
|
}}</span>
|
||||||
<check-social-action
|
<check-social-action
|
||||||
v-for="action in socialActionsList"
|
v-for="action in group.actions"
|
||||||
:key="action.id"
|
:key="action.id"
|
||||||
:action="action"
|
:action="action"
|
||||||
:selection="socialActionsSelected"
|
:selection="socialActionsSelected"
|
||||||
@update-selected="updateActionsSelected"
|
@updateSelected="updateActionsSelected"
|
||||||
/>
|
>
|
||||||
|
</check-social-action>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -80,7 +93,7 @@
|
|||||||
"
|
"
|
||||||
class="inline-choice chill-no-data-statement mt-3"
|
class="inline-choice chill-no-data-statement mt-3"
|
||||||
>
|
>
|
||||||
{{ $t("activity.social_action_list_empty") }}
|
{{ trans(ACTIVITY_SOCIAL_ACTION_LIST_EMPTY) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -92,6 +105,14 @@ import VueMultiselect from "vue-multiselect";
|
|||||||
import CheckSocialIssue from "./SocialIssuesAcc/CheckSocialIssue.vue";
|
import CheckSocialIssue from "./SocialIssuesAcc/CheckSocialIssue.vue";
|
||||||
import CheckSocialAction from "./SocialIssuesAcc/CheckSocialAction.vue";
|
import CheckSocialAction from "./SocialIssuesAcc/CheckSocialAction.vue";
|
||||||
import { getSocialIssues, getSocialActionByIssue } from "../api.js";
|
import { getSocialIssues, getSocialActionByIssue } from "../api.js";
|
||||||
|
import {
|
||||||
|
ACTIVITY_SOCIAL_ACTION_LIST_EMPTY,
|
||||||
|
ACTIVITY_SELECT_FIRST_A_SOCIAL_ISSUE,
|
||||||
|
ACTIVITY_SOCIAL_ACTIONS,
|
||||||
|
ACTIVITY_SOCIAL_ISSUES,
|
||||||
|
ACTIVITY_CHOOSE_OTHER_SOCIAL_ISSUE,
|
||||||
|
trans,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SocialIssuesAcc",
|
name: "SocialIssuesAcc",
|
||||||
@ -100,6 +121,16 @@ export default {
|
|||||||
CheckSocialAction,
|
CheckSocialAction,
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
trans,
|
||||||
|
ACTIVITY_SOCIAL_ACTION_LIST_EMPTY,
|
||||||
|
ACTIVITY_SELECT_FIRST_A_SOCIAL_ISSUE,
|
||||||
|
ACTIVITY_SOCIAL_ACTIONS,
|
||||||
|
ACTIVITY_SOCIAL_ISSUES,
|
||||||
|
ACTIVITY_CHOOSE_OTHER_SOCIAL_ISSUE,
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
issueIsLoading: false,
|
issueIsLoading: false,
|
||||||
@ -127,53 +158,44 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
/* Load others issues in multiselect
|
/* Load other issues in multiselect */
|
||||||
*/
|
|
||||||
this.issueIsLoading = true;
|
this.issueIsLoading = true;
|
||||||
this.actionAreLoaded = false;
|
this.actionAreLoaded = false;
|
||||||
getSocialIssues().then(
|
|
||||||
(response) =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
this.$store.commit("updateIssuesOther", response.results);
|
|
||||||
|
|
||||||
/* Add in list the issues already associated (if not yet listed)
|
getSocialIssues().then((response) => {
|
||||||
*/
|
/* Add issues to the store */
|
||||||
this.socialIssuesSelected.forEach((issue) => {
|
this.$store.commit("updateIssuesOther", response);
|
||||||
if (
|
|
||||||
this.socialIssuesList.filter(
|
|
||||||
(i) => i.id === issue.id,
|
|
||||||
).length !== 1
|
|
||||||
) {
|
|
||||||
this.$store.commit("addIssueInList", issue);
|
|
||||||
}
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
/* Remove from multiselect the issues that are not yet in checkbox list
|
/* Add in list the issues already associated (if not yet listed) */
|
||||||
*/
|
this.socialIssuesSelected.forEach((issue) => {
|
||||||
this.socialIssuesList.forEach((issue) => {
|
if (
|
||||||
this.$store.commit("removeIssueInOther", issue);
|
this.socialIssuesList.filter((i) => i.id === issue.id)
|
||||||
}, this);
|
.length !== 1
|
||||||
|
) {
|
||||||
|
this.$store.commit("addIssueInList", issue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/* Filter issues
|
/* Remove from multiselect the issues that are not yet in the checkbox list */
|
||||||
*/
|
this.socialIssuesList.forEach((issue) => {
|
||||||
this.$store.commit("filterList", "issues");
|
this.$store.commit("removeIssueInOther", issue);
|
||||||
|
});
|
||||||
|
|
||||||
/* Add in list the actions already associated (if not yet listed)
|
/* Filter issues */
|
||||||
*/
|
this.$store.commit("filterList", "issues");
|
||||||
this.socialActionsSelected.forEach((action) => {
|
|
||||||
this.$store.commit("addActionInList", action);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
/* Filter issues
|
/* Add in list the actions already associated (if not yet listed) */
|
||||||
*/
|
this.socialActionsSelected.forEach((action) => {
|
||||||
this.$store.commit("filterList", "actions");
|
this.$store.commit("addActionInList", action);
|
||||||
|
});
|
||||||
|
|
||||||
this.issueIsLoading = false;
|
/* Filter actions */
|
||||||
this.actionAreLoaded = true;
|
this.$store.commit("filterList", "actions");
|
||||||
this.updateActionsList();
|
|
||||||
resolve();
|
this.issueIsLoading = false;
|
||||||
}),
|
this.actionAreLoaded = true;
|
||||||
);
|
this.updateActionsList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/* When choosing an issue in multiselect, add it in checkboxes (as selected),
|
/* When choosing an issue in multiselect, add it in checkboxes (as selected),
|
||||||
@ -208,7 +230,7 @@ export default {
|
|||||||
this.actionIsLoading = true;
|
this.actionIsLoading = true;
|
||||||
getSocialActionByIssue(item.id).then(
|
getSocialActionByIssue(item.id).then(
|
||||||
(actions) =>
|
(actions) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve) => {
|
||||||
actions.results.forEach((action) => {
|
actions.results.forEach((action) => {
|
||||||
this.$store.commit("addActionInList", action);
|
this.$store.commit("addActionInList", action);
|
||||||
}, this);
|
}, this);
|
||||||
@ -235,9 +257,24 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import "ChillMainAssets/module/bootstrap/shared";
|
||||||
|
@import "ChillPersonAssets/chill/scss/mixins";
|
||||||
|
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||||
|
|
||||||
span.multiselect__single {
|
span.multiselect__single {
|
||||||
display: none !important;
|
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>
|
</style>
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
:value="action"
|
:value="action"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" :for="action.id">
|
<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>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
@ -43,5 +45,9 @@ span.badge {
|
|||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
|
max-width: 100%; /* Adjust as needed */
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -26,6 +26,7 @@ const store = createStore({
|
|||||||
state: {
|
state: {
|
||||||
me: null,
|
me: null,
|
||||||
activity: window.activity,
|
activity: window.activity,
|
||||||
|
accompanyingPeriodWorks: [],
|
||||||
socialIssuesOther: [],
|
socialIssuesOther: [],
|
||||||
socialActionsList: [],
|
socialActionsList: [],
|
||||||
availableLocations: [],
|
availableLocations: [],
|
||||||
@ -41,7 +42,7 @@ const store = createStore({
|
|||||||
const allEntities = [
|
const allEntities = [
|
||||||
...store.getters.suggestedPersons,
|
...store.getters.suggestedPersons,
|
||||||
...store.getters.suggestedRequestor,
|
...store.getters.suggestedRequestor,
|
||||||
...store.getters.suggestedUser,
|
...store.getters.suggestedUsers,
|
||||||
...store.getters.suggestedResources,
|
...store.getters.suggestedResources,
|
||||||
];
|
];
|
||||||
const uniqueIds = [
|
const uniqueIds = [
|
||||||
@ -80,8 +81,7 @@ const store = createStore({
|
|||||||
state.activity.activityType.thirdPartiesVisible !== 0),
|
state.activity.activityType.thirdPartiesVisible !== 0),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
suggestedUser(state) {
|
suggestedUsers(state) {
|
||||||
// console.log('current user', state.me)
|
|
||||||
const existingUserIds = state.activity.users.map((p) => p.id);
|
const existingUserIds = state.activity.users.map((p) => p.id);
|
||||||
let suggestedUsers =
|
let suggestedUsers =
|
||||||
state.activity.activityType.usersVisible === 0
|
state.activity.activityType.usersVisible === 0
|
||||||
@ -90,11 +90,18 @@ const store = createStore({
|
|||||||
(u) => u !== null && !existingUserIds.includes(u.id),
|
(u) => u !== null && !existingUserIds.includes(u.id),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
state.accompanyingPeriodWorks.forEach((work) => {
|
||||||
|
work.referrers.forEach((r) => {
|
||||||
|
if (!existingUserIds.includes(r.id)) {
|
||||||
|
suggestedUsers.push(r);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
// Add the current user from the state
|
// Add the current user from the state
|
||||||
if (state.me && !existingUserIds.includes(state.me.id)) {
|
if (state.me && !existingUserIds.includes(state.me.id)) {
|
||||||
suggestedUsers.push(state.me);
|
suggestedUsers.push(state.me);
|
||||||
}
|
}
|
||||||
console.log("suggested users", suggestedUsers);
|
// console.log("suggested users", suggestedUsers);
|
||||||
|
|
||||||
return suggestedUsers;
|
return suggestedUsers;
|
||||||
},
|
},
|
||||||
@ -117,9 +124,19 @@ const store = createStore({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
socialActionsListSorted(state) {
|
socialActionsListSorted(state) {
|
||||||
return [...state.socialActionsList].sort(
|
return [...state.socialActionsList]
|
||||||
(a, b) => a.ordering - b.ordering,
|
.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: {
|
mutations: {
|
||||||
@ -223,6 +240,9 @@ const store = createStore({
|
|||||||
addAvailableLocationGroup(state, group) {
|
addAvailableLocationGroup(state, group) {
|
||||||
state.availableLocations.push(group);
|
state.availableLocations.push(group);
|
||||||
},
|
},
|
||||||
|
setAccompanyingPeriodWorks(state, works) {
|
||||||
|
state.accompanyingPeriodWorks = works;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
addIssueSelected({ commit }, issue) {
|
addIssueSelected({ commit }, issue) {
|
||||||
@ -341,6 +361,17 @@ const store = createStore({
|
|||||||
}
|
}
|
||||||
commit("updateLocation", value);
|
commit("updateLocation", value);
|
||||||
},
|
},
|
||||||
|
async fetchAccompanyingPeriodWorks({ state, commit }) {
|
||||||
|
const accompanyingPeriodId = state.activity.accompanyingPeriod.id;
|
||||||
|
const url = `/api/1.0/person/accompanying-course/${accompanyingPeriodId}/works.json`;
|
||||||
|
try {
|
||||||
|
const works = await makeFetch("GET", url);
|
||||||
|
// console.log("works", works);
|
||||||
|
commit("setAccompanyingPeriodWorks", works);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Failed to fetch accompanying period works:", error);
|
||||||
|
}
|
||||||
|
},
|
||||||
getWhoAmI({ commit }) {
|
getWhoAmI({ commit }) {
|
||||||
const url = `/api/1.0/main/whoami.json`;
|
const url = `/api/1.0/main/whoami.json`;
|
||||||
makeFetch("GET", url).then((user) => {
|
makeFetch("GET", url).then((user) => {
|
||||||
@ -353,5 +384,6 @@ const store = createStore({
|
|||||||
store.dispatch("getWhoAmI");
|
store.dispatch("getWhoAmI");
|
||||||
|
|
||||||
prepareLocations(store);
|
prepareLocations(store);
|
||||||
|
store.dispatch("fetchAccompanyingPeriodWorks");
|
||||||
|
|
||||||
export default store;
|
export default store;
|
||||||
|
@ -13,44 +13,44 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-col" style="width: unset">
|
<div class="item-two-col-grid">
|
||||||
{% if document.isPending %}
|
<div class="title">
|
||||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
{% if document.isPending %}
|
||||||
{% elseif document.isFailure %}
|
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
{% elseif document.isFailure %}
|
||||||
{% endif %}
|
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||||
|
|
||||||
<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>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="badge-activity-type">
|
|
||||||
<span class="title_label"></span>
|
<div>
|
||||||
<span class="title_action">
|
<div>
|
||||||
{{ activity.type.name | localize_translatable_string }}
|
<div class="badge-activity-type-simple">
|
||||||
|
{{ activity.type.name | localize_translatable_string }}
|
||||||
|
</div>
|
||||||
{% if activity.emergency %}
|
{% if activity.emergency %}
|
||||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="denomination h2">
|
||||||
<div class="denomination h2">
|
{{ document.title|chill_print_or_message("No title") }}
|
||||||
{{ document.title|chill_print_or_message("No title") }}
|
|
||||||
</div>
|
|
||||||
{% if document.hasTemplate %}
|
|
||||||
<div>
|
|
||||||
<p>{{ document.template.name|localize_translatable_string }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% if document.hasTemplate %}
|
||||||
</div>
|
<div>
|
||||||
|
<p>{{ document.template.name|localize_translatable_string }}</p>
|
||||||
<div class="item-col">
|
</div>
|
||||||
<div class="container">
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="aside">
|
||||||
<div class="dates row text-end">
|
<div class="dates row text-end">
|
||||||
<span>{{ document.createdAt|format_date('short') }}</span>
|
<span>{{ document.createdAt|format_date('short') }}</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -143,7 +143,10 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
array_filter(
|
array_filter(
|
||||||
$works,
|
$works,
|
||||||
function ($work) use ($user) {
|
function ($work) use ($user) {
|
||||||
$workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []);
|
$workUsernames = [];
|
||||||
|
foreach ($work['referrers'] as $referrer) {
|
||||||
|
$workUsernames[] = $referrer['username'];
|
||||||
|
}
|
||||||
|
|
||||||
return \in_array($user->getUserIdentifier(), $workUsernames, true);
|
return \in_array($user->getUserIdentifier(), $workUsernames, true);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,32 @@ activity:
|
|||||||
Remove a document: Supprimer le document
|
Remove a document: Supprimer le document
|
||||||
comment: Commentaire
|
comment: Commentaire
|
||||||
deleted: Échange supprimé
|
deleted: Échange supprimé
|
||||||
|
|
||||||
|
errors: Le formulaire contient des erreurs
|
||||||
|
social_issues: Problématiques sociales
|
||||||
|
choose_other_social_issue: Ajouter une autre problématique sociale...
|
||||||
|
social_actions: Actions d'accompagnement
|
||||||
|
select_first_a_social_issue: Sélectionnez d'abord une problématique sociale
|
||||||
|
social_action_list_empty: Aucune action sociale disponible
|
||||||
|
add_persons: Ajouter des personnes concernées
|
||||||
|
bloc_persons: Usagers
|
||||||
|
bloc_persons_associated: Usagers du parcours
|
||||||
|
bloc_persons_not_associated: Tiers non-pro.
|
||||||
|
bloc_thirdparty: Tiers professionnels
|
||||||
|
bloc_users: T(M)S
|
||||||
|
location: Localisation
|
||||||
|
choose_location: Choisissez une localisation
|
||||||
|
choose_location_type: Choisissez un type de localisation
|
||||||
|
create_new_location: Créer une nouvelle localisation
|
||||||
|
location_fields:
|
||||||
|
name: Nom
|
||||||
|
type: Type
|
||||||
|
phonenumber1: Téléphone
|
||||||
|
phonenumber2: Autre téléphone
|
||||||
|
email: Adresse courriel
|
||||||
|
create_address: Créer une adresse
|
||||||
|
edit_address: Modifier l'adresse
|
||||||
|
|
||||||
No documents: Aucun document
|
No documents: Aucun document
|
||||||
|
|
||||||
# activity filter in list page
|
# activity filter in list page
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
|
||||||
@import '~ChillMainAssets/module/bootstrap/shared';
|
@import '~ChillMainAssets/module/bootstrap/shared';
|
||||||
|
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
||||||
|
@import 'bootstrap/scss/_badge.scss';
|
||||||
|
|
||||||
.badge-calendar {
|
.badge-calendar {
|
||||||
display: inline-block;
|
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 {
|
& > a.calendar-list__global {
|
||||||
display: inline-block;;
|
display: inline-block;
|
||||||
padding: 0.2rem;
|
padding: 0.2rem;
|
||||||
min-width: 2rem;
|
min-width: 2rem;
|
||||||
border: 1px solid var(--bs-chill-blue);
|
border: 1px solid var(--bs-chill-blue);
|
||||||
|
@ -96,23 +96,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||||
<template v-slot:eventContent="arg: EventApi">
|
<template v-slot:eventContent="{ event }">
|
||||||
<span :class="eventClasses(arg.event)">
|
<span :class="eventClasses(event)">
|
||||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
<b v-if="event.extendedProps.is === 'remote'">{{
|
||||||
arg.event.title
|
event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
<b v-else-if="event.extendedProps.is === 'range'"
|
||||||
>{{ arg.timeText }} -
|
>{{ formatDate(event.startStr) }} -
|
||||||
{{ arg.event.extendedProps.locationName }}</b
|
{{ event.extendedProps.locationName }}</b
|
||||||
>
|
>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
<b v-else-if="event.extendedProps.is === 'local'">{{
|
||||||
arg.event.title
|
event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else>no 'is'</b>
|
<b v-else>no 'is'</b>
|
||||||
<a
|
<a
|
||||||
v-if="arg.event.extendedProps.is === 'range'"
|
v-if="event.extendedProps.is === 'range'"
|
||||||
class="fa fa-fw fa-times delete"
|
class="fa fa-fw fa-times delete"
|
||||||
@click.prevent="onClickDelete(arg.event)"
|
@click.prevent="onClickDelete(event)"
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
@ -221,13 +221,12 @@ import type {
|
|||||||
DatesSetArg,
|
DatesSetArg,
|
||||||
EventInput,
|
EventInput,
|
||||||
} from "@fullcalendar/core";
|
} from "@fullcalendar/core";
|
||||||
import { reactive, computed, ref, onMounted } from "vue";
|
import { computed, ref, onMounted } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { key } from "./store";
|
import { key } from "./store";
|
||||||
import FullCalendar from "@fullcalendar/vue3";
|
import FullCalendar from "@fullcalendar/vue3";
|
||||||
import frLocale from "@fullcalendar/core/locales/fr";
|
import frLocale from "@fullcalendar/core/locales/fr";
|
||||||
import interactionPlugin, {
|
import interactionPlugin, {
|
||||||
DropArg,
|
|
||||||
EventResizeDoneArg,
|
EventResizeDoneArg,
|
||||||
} from "@fullcalendar/interaction";
|
} from "@fullcalendar/interaction";
|
||||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||||
@ -237,19 +236,13 @@ import {
|
|||||||
EventDropArg,
|
EventDropArg,
|
||||||
EventClickArg,
|
EventClickArg,
|
||||||
} from "@fullcalendar/core";
|
} from "@fullcalendar/core";
|
||||||
import {
|
import { dateToISO, ISOToDate } from "ChillMainAssets/chill/js/date";
|
||||||
dateToISO,
|
|
||||||
ISOToDate,
|
|
||||||
} from "../../../../../ChillMainBundle/Resources/public/chill/js/date";
|
|
||||||
import VueMultiselect from "vue-multiselect";
|
import VueMultiselect from "vue-multiselect";
|
||||||
import { Location } from "../../../../../ChillMainBundle/Resources/public/types";
|
import { Location } from "ChillMainAssets/types";
|
||||||
import EditLocation from "./Components/EditLocation.vue";
|
import EditLocation from "./Components/EditLocation.vue";
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
|
|
||||||
const store = useStore(key);
|
const store = useStore(key);
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const showWeekends = ref(false);
|
const showWeekends = ref(false);
|
||||||
const slotDuration = ref("00:15:00");
|
const slotDuration = ref("00:15:00");
|
||||||
const slotMinTime = ref("09:00:00");
|
const slotMinTime = ref("09:00:00");
|
||||||
@ -301,6 +294,11 @@ const nextWeeks = computed((): Weeks[] =>
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const formatDate = (datetime: string) => {
|
||||||
|
console.log(typeof datetime);
|
||||||
|
return ISOToDate(datetime);
|
||||||
|
};
|
||||||
|
|
||||||
const baseOptions = ref<CalendarOptions>({
|
const baseOptions = ref<CalendarOptions>({
|
||||||
locale: frLocale,
|
locale: frLocale,
|
||||||
plugins: [interactionPlugin, timeGridPlugin],
|
plugins: [interactionPlugin, timeGridPlugin],
|
||||||
@ -353,7 +351,7 @@ const pickedLocation = computed<Location | null>({
|
|||||||
* return the show classes for the event
|
* return the show classes for the event
|
||||||
* @param arg
|
* @param arg
|
||||||
*/
|
*/
|
||||||
const eventClasses = function (arg: EventApi): object {
|
const eventClasses = function (): object {
|
||||||
return { calendarRangeItems: true };
|
return { calendarRangeItems: true };
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -431,7 +429,6 @@ function onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {
|
|||||||
if (payload.event.extendedProps.is !== "range") {
|
if (payload.event.extendedProps.is !== "range") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const changedEvent = payload.event;
|
|
||||||
|
|
||||||
store.dispatch("calendarRanges/patchRangeTime", {
|
store.dispatch("calendarRanges/patchRangeTime", {
|
||||||
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
||||||
|
@ -6,50 +6,48 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-col" style="width: unset">
|
<div class="item-two-col-grid">
|
||||||
{% if document.storedObject.isPending %}
|
<div class="title">
|
||||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
{% if document.storedObject.isPending %}
|
||||||
{% elseif document.storedObject.isFailure %}
|
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
{% elseif document.storedObject.isFailure %}
|
||||||
{% endif %}
|
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||||
|
|
||||||
<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>
|
|
||||||
{% endif %}
|
{% 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>
|
<div>
|
||||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item-col">
|
<span class="badge-calendar-simple">
|
||||||
<div class="container">
|
{{ '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">
|
<div class="dates row text-end">
|
||||||
<span>{{ document.storedObject.createdAt|format_date('short') }}</span>
|
<span>{{ document.storedObject.createdAt|format_date('short') }}</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,9 @@ const startApp = (
|
|||||||
collectionEntry: null | HTMLLIElement,
|
collectionEntry: null | HTMLLIElement,
|
||||||
): void => {
|
): void => {
|
||||||
console.log("app started", divElement);
|
console.log("app started", divElement);
|
||||||
|
|
||||||
|
const inputTitle = collectionEntry?.querySelector("input[type='text']");
|
||||||
|
|
||||||
const input_stored_object: HTMLInputElement | null =
|
const input_stored_object: HTMLInputElement | null =
|
||||||
divElement.querySelector("input[data-stored-object]");
|
divElement.querySelector("input[data-stored-object]");
|
||||||
if (null === input_stored_object) {
|
if (null === input_stored_object) {
|
||||||
@ -26,9 +29,10 @@ const startApp = (
|
|||||||
const app = createApp({
|
const app = createApp({
|
||||||
template:
|
template:
|
||||||
'<drop-file-widget :existingDoc="this.$data.existingDoc" :allowRemove="true" @addDocument="this.addDocument" @removeDocument="removeDocument"></drop-file-widget>',
|
'<drop-file-widget :existingDoc="this.$data.existingDoc" :allowRemove="true" @addDocument="this.addDocument" @removeDocument="removeDocument"></drop-file-widget>',
|
||||||
data(vm) {
|
data() {
|
||||||
return {
|
return {
|
||||||
existingDoc: existingDoc,
|
existingDoc: existingDoc,
|
||||||
|
inputTitle: inputTitle,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -38,10 +42,13 @@ const startApp = (
|
|||||||
addDocument: function ({
|
addDocument: function ({
|
||||||
stored_object,
|
stored_object,
|
||||||
stored_object_version,
|
stored_object_version,
|
||||||
|
file_name,
|
||||||
}: {
|
}: {
|
||||||
stored_object: StoredObject;
|
stored_object: StoredObject;
|
||||||
stored_object_version: StoredObjectVersion;
|
stored_object_version: StoredObjectVersion;
|
||||||
|
file_name: string;
|
||||||
}): void {
|
}): void {
|
||||||
|
stored_object.title = file_name;
|
||||||
console.log("object added", stored_object);
|
console.log("object added", stored_object);
|
||||||
console.log("version added", stored_object_version);
|
console.log("version added", stored_object_version);
|
||||||
this.$data.existingDoc = stored_object;
|
this.$data.existingDoc = stored_object;
|
||||||
@ -49,6 +56,11 @@ const startApp = (
|
|||||||
input_stored_object.value = JSON.stringify(
|
input_stored_object.value = JSON.stringify(
|
||||||
this.$data.existingDoc,
|
this.$data.existingDoc,
|
||||||
);
|
);
|
||||||
|
if (this.$data.inputTitle) {
|
||||||
|
if (!this.$data.inputTitle?.value) {
|
||||||
|
this.$data.inputTitle.value = file_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
removeDocument: function (object: StoredObject): void {
|
removeDocument: function (object: StoredObject): void {
|
||||||
console.log("catch remove document", object);
|
console.log("catch remove document", object);
|
||||||
|
@ -2,26 +2,28 @@
|
|||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
<modal v-if="modalOpen" @close="modalOpen = false">
|
<modal v-if="modalOpen" @close="modalOpen = false">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h2>{{ $t("signature_confirmation") }}</h2>
|
<h2>{{ trans(SIGNATURES_SIGNATURE_CONFIRMATION) }}</h2>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<div class="signature-modal-body text-center" v-if="loading">
|
<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">
|
<div class="loading">
|
||||||
<i
|
<i
|
||||||
class="fa fa-circle-o-notch fa-spin fa-3x"
|
class="fa fa-circle-o-notch fa-spin fa-3x"
|
||||||
:title="$t('loading')"
|
:title="trans(SIGNATURES_LOADING)"
|
||||||
></i>
|
></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="signature-modal-body text-center" v-else>
|
<div class="signature-modal-body text-center" v-else>
|
||||||
<p>{{ $t("you_are_going_to_sign") }}</p>
|
<p>{{ trans(SIGNATURES_YOU_ARE_GOING_TO_SIGN) }}</p>
|
||||||
<p>{{ $t("are_you_sure") }}</p>
|
<p>{{ trans(SIGNATURES_ARE_YOU_SURE) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button class="btn btn-action" @click.prevent="confirmSign">
|
<button class="btn btn-action" @click.prevent="confirmSign">
|
||||||
{{ $t("yes") }}
|
{{ trans(SIGNATURES_YES) }}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
@ -82,33 +84,39 @@
|
|||||||
@change="toggleMultiPage"
|
@change="toggleMultiPage"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="checkboxMulti">
|
<label class="form-check-label" for="checkboxMulti">
|
||||||
{{ $t("all_pages") }}
|
{{ trans(SIGNATURES_ALL_PAGES) }}
|
||||||
</label>
|
</label>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="signature.zones.length > 0"
|
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
||||||
class="col-5 p-0 text-center turnSignature"
|
class="col-5 p-0 text-center turnSignature"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
:disabled="
|
class="btn btn-light btn-sm"
|
||||||
userSignatureZone === null ||
|
@click="goToSignatureZoneUnique"
|
||||||
userSignatureZone?.index < 1
|
>
|
||||||
"
|
{{ 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"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(-1)"
|
@click="turnSignature(-1)"
|
||||||
>
|
>
|
||||||
{{ $t("last_zone") }}
|
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||||
</button>
|
</button>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<button
|
<button
|
||||||
:disabled="
|
:disabled="isLastSignatureZone()"
|
||||||
userSignatureZone?.index >= signature.zones.length - 1
|
|
||||||
"
|
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(1)"
|
@click="turnSignature(1)"
|
||||||
>
|
>
|
||||||
{{ $t("next_zone") }}
|
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||||
@ -117,9 +125,9 @@
|
|||||||
:hidden="!userSignatureZone"
|
:hidden="!userSignatureZone"
|
||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-if="signature.zones.length > 1"
|
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>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc btn-sm"
|
class="btn btn-misc btn-sm"
|
||||||
@ -127,7 +135,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-else
|
v-else
|
||||||
>
|
>
|
||||||
{{ $t("cancel") }}
|
{{ trans(SIGNATURES_CANCEL) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="userSignatureZone === null"
|
v-if="userSignatureZone === null"
|
||||||
@ -139,7 +147,7 @@
|
|||||||
active: canvasEvent === 'add',
|
active: canvasEvent === 'add',
|
||||||
}"
|
}"
|
||||||
@click="toggleAddZone()"
|
@click="toggleAddZone()"
|
||||||
:title="$t('add_sign_zone')"
|
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||||
>
|
>
|
||||||
<template v-if="canvasEvent === 'add'">
|
<template v-if="canvasEvent === 'add'">
|
||||||
<div
|
<div
|
||||||
@ -191,58 +199,70 @@
|
|||||||
@change="toggleMultiPage"
|
@change="toggleMultiPage"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="checkboxMulti">
|
<label class="form-check-label" for="checkboxMulti">
|
||||||
{{ $t("see_all_pages") }}
|
{{ trans(SIGNATURES_SEE_ALL_PAGES) }}
|
||||||
</label>
|
</label>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<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"
|
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
:disabled="
|
|
||||||
userSignatureZone === null ||
|
|
||||||
userSignatureZone?.index < 1
|
|
||||||
"
|
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(-1)"
|
@click="goToSignatureZoneUnique"
|
||||||
>
|
>
|
||||||
{{ $t("last_zone") }}
|
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
||||||
</button>
|
|
||||||
<span>|</span>
|
|
||||||
<button
|
|
||||||
:disabled="
|
|
||||||
userSignatureZone?.index >= signature.zones.length - 1
|
|
||||||
"
|
|
||||||
class="btn btn-light btn-sm"
|
|
||||||
@click="turnSignature(1)"
|
|
||||||
>
|
|
||||||
{{ $t("next_zone") }}
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="signature.zones.length > 0 && signedState !== 'signed'"
|
v-if="signature.zones.length > 1 && signedState !== 'signed'"
|
||||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
class="col-4 d-xl-none text-center turnSignature p-0"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
:disabled="
|
:disabled="isFirstSignatureZone()"
|
||||||
userSignatureZone === null ||
|
|
||||||
userSignatureZone?.index < 1
|
|
||||||
"
|
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(-1)"
|
@click="turnSignature(-1)"
|
||||||
>
|
>
|
||||||
{{ $t("last_sign_zone") }}
|
{{ trans(SIGNATURES_LAST_ZONE) }}
|
||||||
</button>
|
</button>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<button
|
<button
|
||||||
:disabled="
|
:disabled="isLastSignatureZone()"
|
||||||
userSignatureZone?.index >= signature.zones.length - 1
|
|
||||||
"
|
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(1)"
|
@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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||||
@ -252,7 +272,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-if="signature.zones.length > 1"
|
v-if="signature.zones.length > 1"
|
||||||
>
|
>
|
||||||
{{ $t("choose_another_signature") }}
|
{{ trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc btn-sm"
|
class="btn btn-misc btn-sm"
|
||||||
@ -260,7 +280,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-else
|
v-else
|
||||||
>
|
>
|
||||||
{{ $t("cancel") }}
|
{{ trans(SIGNATURES_CANCEL) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="userSignatureZone === null"
|
v-if="userSignatureZone === null"
|
||||||
@ -272,13 +292,13 @@
|
|||||||
active: canvasEvent === 'add',
|
active: canvasEvent === 'add',
|
||||||
}"
|
}"
|
||||||
@click="toggleAddZone()"
|
@click="toggleAddZone()"
|
||||||
:title="$t('add_sign_zone')"
|
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
||||||
>
|
>
|
||||||
<template v-if="canvasEvent !== 'add'">
|
<template v-if="canvasEvent !== 'add'">
|
||||||
{{ $t("add_zone") }}
|
{{ trans(SIGNATURES_ADD_ZONE) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{ $t("click_on_document") }}
|
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
||||||
<div
|
<div
|
||||||
class="spinner-border spinner-border-sm"
|
class="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
@ -312,10 +332,10 @@
|
|||||||
v-if="signedState !== 'signed'"
|
v-if="signedState !== 'signed'"
|
||||||
:href="getReturnPath()"
|
:href="getReturnPath()"
|
||||||
>
|
>
|
||||||
{{ $t("cancel") }}
|
{{ trans(SIGNATURES_CANCEL) }}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
||||||
{{ $t("return") }}
|
{{ trans(SIGNATURES_RETURN) }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||||
@ -324,7 +344,7 @@
|
|||||||
:disabled="!userSignatureZone"
|
:disabled="!userSignatureZone"
|
||||||
@click="sign"
|
@click="sign"
|
||||||
>
|
>
|
||||||
{{ $t("sign") }}
|
{{ trans(SIGNATURES_SIGN) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4" v-else></div>
|
<div class="col-4" v-else></div>
|
||||||
@ -333,7 +353,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, Ref, reactive } from "vue";
|
import { ref, Ref } from "vue";
|
||||||
import { useToast } from "vue-toast-notification";
|
import { useToast } from "vue-toast-notification";
|
||||||
import "vue-toast-notification/dist/theme-sugar.css";
|
import "vue-toast-notification/dist/theme-sugar.css";
|
||||||
import {
|
import {
|
||||||
@ -344,25 +364,47 @@ import {
|
|||||||
SignedState,
|
SignedState,
|
||||||
ZoomLevel,
|
ZoomLevel,
|
||||||
} from "../../types";
|
} 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 * as pdfjsLib from "pdfjs-dist";
|
||||||
import {
|
import {
|
||||||
PDFDocumentProxy,
|
PDFDocumentProxy,
|
||||||
PDFPageProxy,
|
PDFPageProxy,
|
||||||
} from "pdfjs-dist/types/src/display/api";
|
} 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";
|
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'
|
// import { PdfWorker } from 'pdfjs-dist/build/pdf.worker.mjs'
|
||||||
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
||||||
|
|
||||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||||
import {
|
import { download_doc_as_pdf } from "../StoredObjectButton/helpers";
|
||||||
download_and_decrypt_doc,
|
|
||||||
download_doc_as_pdf,
|
|
||||||
} from "../StoredObjectButton/helpers";
|
|
||||||
|
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
||||||
|
|
||||||
@ -433,6 +475,16 @@ const $toast = useToast();
|
|||||||
|
|
||||||
const signature = window.signature;
|
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) => {
|
const setZoomLevel = async (zoomLevel: string) => {
|
||||||
zoom.value = Number.parseFloat(zoomLevel);
|
zoom.value = Number.parseFloat(zoomLevel);
|
||||||
await resetPages();
|
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) => {
|
const turnSignature = async (upOrDown: number) => {
|
||||||
let zoneIndex = userSignatureZone.value?.index ?? -1;
|
let zoneIndex = userSignatureZone.value?.index ?? -1;
|
||||||
if (zoneIndex < -1) {
|
if (zoneIndex < -1) {
|
||||||
@ -616,10 +677,7 @@ const turnSignature = async (upOrDown: number) => {
|
|||||||
}
|
}
|
||||||
let currentZone = signature.zones[zoneIndex];
|
let currentZone = signature.zones[zoneIndex];
|
||||||
if (currentZone) {
|
if (currentZone) {
|
||||||
page.value = currentZone.PDFPage.index + 1;
|
selectZoneInCanvas(currentZone);
|
||||||
const canvas = getCanvas(currentZone.PDFPage.index + 1);
|
|
||||||
selectZone(currentZone, canvas);
|
|
||||||
canvas.scrollIntoView();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -754,7 +812,7 @@ const confirmSign = () => {
|
|||||||
zone: userSignatureZone.value,
|
zone: userSignatureZone.value,
|
||||||
};
|
};
|
||||||
makeFetch("POST", url, body)
|
makeFetch("POST", url, body)
|
||||||
.then((r) => {
|
.then(() => {
|
||||||
checkForReady();
|
checkForReady();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -776,9 +834,7 @@ const undoSign = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const toggleAddZone = () => {
|
const toggleAddZone = () => {
|
||||||
canvasEvent.value === "select"
|
canvasEvent.value = canvasEvent.value === "select" ? "add" : "select";
|
||||||
? (canvasEvent.value = "add")
|
|
||||||
: (canvasEvent.value = "select");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
||||||
|
@ -23,6 +23,7 @@ const emit =
|
|||||||
{
|
{
|
||||||
stored_object_version: StoredObjectVersionCreated,
|
stored_object_version: StoredObjectVersionCreated,
|
||||||
stored_object: StoredObject,
|
stored_object: StoredObject,
|
||||||
|
file_name: string,
|
||||||
},
|
},
|
||||||
) => void
|
) => void
|
||||||
>();
|
>();
|
||||||
@ -114,7 +115,21 @@ const handleFile = async (file: File): Promise<void> => {
|
|||||||
persisted: false,
|
persisted: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
emit("addDocument", { stored_object, stored_object_version });
|
const fileName = file.name;
|
||||||
|
let file_name = "Nouveau document";
|
||||||
|
const file_name_split = fileName.split(".");
|
||||||
|
if (file_name_split.length > 1) {
|
||||||
|
const extension = file_name_split
|
||||||
|
? file_name_split[file_name_split.length - 1]
|
||||||
|
: "";
|
||||||
|
file_name = fileName.replace(extension, "").slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit("addDocument", {
|
||||||
|
stored_object,
|
||||||
|
stored_object_version,
|
||||||
|
file_name: file_name,
|
||||||
|
});
|
||||||
uploading.value = false;
|
uploading.value = false;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -20,6 +20,7 @@ const emit = defineEmits<{
|
|||||||
{
|
{
|
||||||
stored_object: StoredObject,
|
stored_object: StoredObject,
|
||||||
stored_object_version: StoredObjectVersion,
|
stored_object_version: StoredObjectVersion,
|
||||||
|
file_name: string,
|
||||||
},
|
},
|
||||||
): void;
|
): void;
|
||||||
(e: "removeDocument"): void;
|
(e: "removeDocument"): void;
|
||||||
@ -42,14 +43,16 @@ const buttonState = computed<"add" | "replace">(() => {
|
|||||||
function onAddDocument({
|
function onAddDocument({
|
||||||
stored_object,
|
stored_object,
|
||||||
stored_object_version,
|
stored_object_version,
|
||||||
|
file_name,
|
||||||
}: {
|
}: {
|
||||||
stored_object: StoredObject;
|
stored_object: StoredObject;
|
||||||
stored_object_version: StoredObjectVersion;
|
stored_object_version: StoredObjectVersion;
|
||||||
|
file_name: string;
|
||||||
}): void {
|
}): void {
|
||||||
const message =
|
const message =
|
||||||
buttonState.value === "add" ? "Document ajouté" : "Document remplacé";
|
buttonState.value === "add" ? "Document ajouté" : "Document remplacé";
|
||||||
$toast.success(message);
|
$toast.success(message);
|
||||||
emit("addDocument", { stored_object_version, stored_object });
|
emit("addDocument", { stored_object_version, stored_object, file_name });
|
||||||
state.showModal = false;
|
state.showModal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ const emit = defineEmits<{
|
|||||||
{
|
{
|
||||||
stored_object: StoredObject,
|
stored_object: StoredObject,
|
||||||
stored_object_version: StoredObjectVersion,
|
stored_object_version: StoredObjectVersion,
|
||||||
|
file_name: string,
|
||||||
},
|
},
|
||||||
): void;
|
): void;
|
||||||
(e: "removeDocument"): void;
|
(e: "removeDocument"): void;
|
||||||
@ -53,11 +54,13 @@ const dav_link_href = computed<string | undefined>(() => {
|
|||||||
const onAddDocument = ({
|
const onAddDocument = ({
|
||||||
stored_object,
|
stored_object,
|
||||||
stored_object_version,
|
stored_object_version,
|
||||||
|
file_name,
|
||||||
}: {
|
}: {
|
||||||
stored_object: StoredObject;
|
stored_object: StoredObject;
|
||||||
stored_object_version: StoredObjectVersion;
|
stored_object_version: StoredObjectVersion;
|
||||||
|
file_name: string;
|
||||||
}): void => {
|
}): void => {
|
||||||
emit("addDocument", { stored_object, stored_object_version });
|
emit("addDocument", { stored_object, stored_object_version, file_name });
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRemoveDocument = (e: Event): void => {
|
const onRemoveDocument = (e: Event): void => {
|
||||||
|
@ -53,7 +53,7 @@ const onRestored = ({
|
|||||||
<template>
|
<template>
|
||||||
<template v-if="props.versions.length > 0">
|
<template v-if="props.versions.length > 0">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<template v-for="v in props.versions">
|
<template v-for="v in props.versions" :key="v.id">
|
||||||
<history-button-list-item
|
<history-button-list-item
|
||||||
:version="v"
|
:version="v"
|
||||||
:can-edit="canEdit"
|
:can-edit="canEdit"
|
||||||
|
@ -32,13 +32,17 @@ const onRestore = ({
|
|||||||
emit("restoreVersion", { newVersion });
|
emit("restoreVersion", { newVersion });
|
||||||
};
|
};
|
||||||
|
|
||||||
const isKeptBeforeConversion = computed<boolean>(() =>
|
const isKeptBeforeConversion = computed<boolean>(() => {
|
||||||
props.version["point-in-times"].reduce(
|
if ("point-in-times" in props.version) {
|
||||||
(accumulator: boolean, pit: StoredObjectPointInTime) =>
|
return props.version["point-in-times"].reduce(
|
||||||
accumulator || "keep-before-conversion" === pit.reason,
|
(accumulator: boolean, pit: StoredObjectPointInTime) =>
|
||||||
false,
|
accumulator || "keep-before-conversion" === pit.reason,
|
||||||
),
|
false,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const isRestored = computed<boolean>(
|
const isRestored = computed<boolean>(
|
||||||
() => props.version.version > 0 && null !== props.version["from-restored"],
|
() => props.version.version > 0 && null !== props.version["from-restored"],
|
||||||
@ -90,11 +94,11 @@ const classes = computed<{
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<file-icon :type="version.type"></file-icon>
|
<file-icon :type="version.type"></file-icon>
|
||||||
<span
|
<span
|
||||||
><strong>#{{ version.version + 1 }}</strong></span
|
><strong> #{{ version.version + 1 }} </strong></span
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
v-if="version.createdBy !== null && version.createdAt !== null"
|
v-if="version.createdBy !== null && version.createdAt !== null"
|
||||||
><strong v-if="version.version == 0">Créé par</strong
|
><strong v-if="version.version == 0">créé par</strong
|
||||||
><strong v-else>modifié par</strong>
|
><strong v-else>modifié par</strong>
|
||||||
<span class="badge-user"
|
<span class="badge-user"
|
||||||
><UserRenderBoxBadge
|
><UserRenderBoxBadge
|
||||||
|
@ -28,6 +28,10 @@ const open = () => {
|
|||||||
state.opened = true;
|
state.opened = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRestoreVersion = (payload: {
|
||||||
|
newVersion: StoredObjectVersionWithPointInTime;
|
||||||
|
}) => emit("restoreVersion", payload);
|
||||||
|
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@ -42,9 +46,7 @@ defineExpose({ open });
|
|||||||
:versions="props.versions"
|
:versions="props.versions"
|
||||||
:can-edit="canEdit"
|
:can-edit="canEdit"
|
||||||
:stored-object="storedObject"
|
:stored-object="storedObject"
|
||||||
@restore-version="
|
@restore-version="onRestoreVersion"
|
||||||
(payload) => emit('restoreVersion', payload)
|
|
||||||
"
|
|
||||||
></history-button-list>
|
></history-button-list>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</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") }}
|
{{ encore_entry_link_tags("mod_document_action_buttons_group") }}
|
||||||
{% endblock %} {% block content %}
|
{% endblock %} {% block content %}
|
||||||
|
|
||||||
<div class="col-md-10 col-xxl">
|
<div class="document-list">
|
||||||
<h1>
|
<h1>
|
||||||
{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}
|
{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}
|
||||||
</h1>
|
</h1>
|
||||||
|
@ -3,54 +3,56 @@
|
|||||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
|
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-col" style="width: unset">
|
<!-- person document or accompanying course document -->
|
||||||
{% if document.object.isPending %}
|
<div class="item-two-col-grid">
|
||||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
<div class="title">
|
||||||
{% elseif document.object.isFailure %}
|
{% if document.object.isPending %}
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||||
{% endif %}
|
{% 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 class="denomination h2">
|
||||||
<div>
|
{{ document.title|chill_print_or_message("No title") }}
|
||||||
<span class="badge bg-primary">
|
|
||||||
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
{% elseif context == 'accompanying-period' and person is defined %}
|
{% if document.object.type is not empty %}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge bg-primary">
|
{{ mm.mimeIcon(document.object.type) }}
|
||||||
{{ 'Document from person %name%'|trans({ '%name%': document.person|chill_entity_render_string }) }}
|
</div>
|
||||||
</span>
|
{% endif %}
|
||||||
</div>
|
{% if document.category %}
|
||||||
|
<div>
|
||||||
{% endif %}
|
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||||
<div class="denomination h2">
|
</div>
|
||||||
{{ document.title|chill_print_or_message("No title") }}
|
{% endif %}
|
||||||
</div>
|
{% if document.object.hasTemplate %}
|
||||||
{% if document.object.type is not empty %}
|
<div>
|
||||||
<div>
|
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
||||||
{{ 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>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% if document.description is not empty %}
|
{% if document.description is not empty %}
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
|
@ -62,7 +62,15 @@ final readonly class RemoveOldVersionMessageHandler implements MessageHandlerInt
|
|||||||
|
|
||||||
$storedObject = $storedObjectVersion->getStoredObject();
|
$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
|
// to ensure an immediate deletion
|
||||||
$this->entityManager->remove($storedObjectVersion);
|
$this->entityManager->remove($storedObjectVersion);
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class RemoveOldVersionMessageHandlerTest extends TestCase
|
|||||||
$entityManager->expects($this->once())->method('clear');
|
$entityManager->expects($this->once())->method('clear');
|
||||||
|
|
||||||
$storedObjectManager = $this->createMock(StoredObjectManagerInterface::class);
|
$storedObjectManager = $this->createMock(StoredObjectManagerInterface::class);
|
||||||
|
$storedObjectManager->expects($this->once())->method('exists')->willReturn(true);
|
||||||
$storedObjectManager->expects($this->once())->method('delete')->with($this->identicalTo($version));
|
$storedObjectManager->expects($this->once())->method('delete')->with($this->identicalTo($version));
|
||||||
|
|
||||||
$handler = new RemoveOldVersionMessageHandler($storedObjectVersionRepository, new NullLogger(), $entityManager, $storedObjectManager, new MockClock());
|
$handler = new RemoveOldVersionMessageHandler($storedObjectVersionRepository, new NullLogger(), $entityManager, $storedObjectManager, new MockClock());
|
||||||
@ -51,6 +52,29 @@ class RemoveOldVersionMessageHandlerTest extends TestCase
|
|||||||
$handler(new RemoveOldVersionMessage(1));
|
$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
|
public function testInvokeWithStoredObjectToDelete(): void
|
||||||
{
|
{
|
||||||
$object = new StoredObject();
|
$object = new StoredObject();
|
||||||
@ -123,6 +147,6 @@ class DummyStoredObjectManager implements StoredObjectManagerInterface
|
|||||||
|
|
||||||
public function exists(StoredObject|StoredObjectVersion $document): bool
|
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:
|
entity_display_title:
|
||||||
Document (n°%doc%): "Document (n°%doc%)"
|
Document (n°%doc%): "Document (n°%doc%)"
|
||||||
Doc for evaluation (n°%eval%): Document de l'évaluation n°%eval%
|
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
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
#events
|
#events
|
||||||
Name: Nom
|
|
||||||
Label: Nom
|
|
||||||
Date: Date
|
|
||||||
Event type : Type d'événement
|
Event type : Type d'événement
|
||||||
See: Voir
|
|
||||||
Event: Événement
|
Event: Événement
|
||||||
Events: Événements
|
Events: Événements
|
||||||
'Event : %label%': Événement "%label%"
|
'Event : %label%': Événement "%label%"
|
||||||
@ -123,7 +119,6 @@ Role: Rôles
|
|||||||
Role creation: Nouveau rôle
|
Role creation: Nouveau rôle
|
||||||
Role edit: Modifier un rôle
|
Role edit: Modifier un rôle
|
||||||
|
|
||||||
'': ''
|
|
||||||
xlsx: xlsx
|
xlsx: xlsx
|
||||||
ods: ods
|
ods: ods
|
||||||
csv: csv
|
csv: csv
|
||||||
|
@ -63,7 +63,6 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
parent::getSubscribedServices(),
|
parent::getSubscribedServices(),
|
||||||
[
|
[
|
||||||
'chill_main.paginator_factory' => PaginatorFactory::class,
|
'chill_main.paginator_factory' => PaginatorFactory::class,
|
||||||
ManagerRegistry::class => ManagerRegistry::class,
|
|
||||||
'translator' => TranslatorInterface::class,
|
'translator' => TranslatorInterface::class,
|
||||||
AuthorizationHelper::class => AuthorizationHelper::class,
|
AuthorizationHelper::class => AuthorizationHelper::class,
|
||||||
EventDispatcherInterface::class => EventDispatcherInterface::class,
|
EventDispatcherInterface::class => EventDispatcherInterface::class,
|
||||||
@ -213,7 +212,7 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
|
|
||||||
protected function getManagerRegistry(): ManagerRegistry
|
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
|
protected function getValidator(): ValidatorInterface
|
||||||
{
|
{
|
||||||
return $this->get('validator');
|
return $this->container->get('validator');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ use Symfony\Component\Form\AbstractType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
|
|
||||||
class ExportType extends AbstractType
|
class ExportType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -29,7 +30,15 @@ class ExportType extends AbstractType
|
|||||||
|
|
||||||
final public const PICK_FORMATTER_KEY = 'pick_formatter';
|
final public const PICK_FORMATTER_KEY = 'pick_formatter';
|
||||||
|
|
||||||
public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) {}
|
private array $personFieldsConfig;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
private readonly ExportManager $exportManager,
|
||||||
|
private readonly SortExportElement $sortExportElement,
|
||||||
|
protected ParameterBagInterface $parameterBag,
|
||||||
|
) {
|
||||||
|
$this->personFieldsConfig = $parameterBag->get('chill_person.person_fields');
|
||||||
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
@ -77,6 +86,17 @@ class ExportType extends AbstractType
|
|||||||
);
|
);
|
||||||
|
|
||||||
foreach ($aggregators as $alias => $aggregator) {
|
foreach ($aggregators as $alias => $aggregator) {
|
||||||
|
/*
|
||||||
|
* eventually mask aggregator
|
||||||
|
*/
|
||||||
|
if (str_starts_with((string) $alias, 'person_') and str_ends_with((string) $alias, '_aggregator')) {
|
||||||
|
$field = preg_replace(['/person_/', '/_aggregator/'], '', (string) $alias);
|
||||||
|
if (array_key_exists($field, $this->personFieldsConfig) and 'visible' !== $this->personFieldsConfig[$field]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$aggregatorBuilder->add($alias, AggregatorType::class, [
|
$aggregatorBuilder->add($alias, AggregatorType::class, [
|
||||||
'aggregator_alias' => $alias,
|
'aggregator_alias' => $alias,
|
||||||
'export_manager' => $this->exportManager,
|
'export_manager' => $this->exportManager,
|
||||||
|
@ -75,8 +75,8 @@ final class UserGroupRepository implements UserGroupRepositoryInterface, LocaleA
|
|||||||
->setWhereClauses('
|
->setWhereClauses('
|
||||||
ug.active AND (
|
ug.active AND (
|
||||||
SIMILARITY(LOWER(UNACCENT(?)), ug.label->>?) > 0.15
|
SIMILARITY(LOWER(UNACCENT(?)), ug.label->>?) > 0.15
|
||||||
OR ug.label->>? LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
OR LOWER(UNACCENT(ug.label->>?)) LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||||
', [$pattern, $lang, $pattern, $lang]);
|
', [$pattern, $lang, $lang, $pattern]);
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,34 @@ div.flex-table {
|
|||||||
div.item-col:last-child {
|
div.item-col:last-child {
|
||||||
display: flex;
|
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 {
|
h2, h3, h4, dl, p {
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
Bold,
|
Bold,
|
||||||
Italic,
|
Italic,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Mention,
|
|
||||||
Markdown,
|
Markdown,
|
||||||
BlockQuote,
|
BlockQuote,
|
||||||
Heading,
|
Heading,
|
||||||
@ -16,9 +15,18 @@ import 'ckeditor5/ckeditor5.css';
|
|||||||
|
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
plugins: [Essentials, Markdown, Bold, Italic, BlockQuote, Heading, Link, List, Paragraph],
|
plugins: [
|
||||||
|
Essentials,
|
||||||
|
Markdown,
|
||||||
|
Bold,
|
||||||
|
Italic,
|
||||||
|
BlockQuote,
|
||||||
|
Heading,
|
||||||
|
Link,
|
||||||
|
List,
|
||||||
|
Paragraph,
|
||||||
|
],
|
||||||
toolbar: {
|
toolbar: {
|
||||||
items: [
|
items: [
|
||||||
"heading",
|
"heading",
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import { createApp } from "vue";
|
import { createApp } from "vue";
|
||||||
import NotificationReadToggle from "ChillMainAssets/vuejs/_components/Notification/NotificationReadToggle.vue";
|
import NotificationReadToggle from "ChillMainAssets/vuejs/_components/Notification/NotificationReadToggle.vue";
|
||||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
||||||
import NotificationReadAllToggle from "ChillMainAssets/vuejs/_components/Notification/NotificationReadAllToggle.vue";
|
|
||||||
|
|
||||||
const i18n = _createI18n({});
|
const i18n = _createI18n({});
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", function (e) {
|
window.addEventListener("DOMContentLoaded", function () {
|
||||||
document
|
document
|
||||||
.querySelectorAll(".notification_toggle_read_status")
|
.querySelectorAll(".notification_toggle_read_status")
|
||||||
.forEach(function (el, i) {
|
.forEach(function (el, i) {
|
||||||
|
@ -26,12 +26,12 @@ function loadDynamicPicker(element) {
|
|||||||
? JSON.parse(input.value)
|
? JSON.parse(input.value)
|
||||||
: input.value === "[]" || input.value === ""
|
: input.value === "[]" || input.value === ""
|
||||||
? null
|
? null
|
||||||
: [JSON.parse(input.value)];
|
: [JSON.parse(input.value)],
|
||||||
(suggested = JSON.parse(el.dataset.suggested)),
|
suggested = JSON.parse(el.dataset.suggested),
|
||||||
(as_id = parseInt(el.dataset.asId) === 1),
|
as_id = parseInt(el.dataset.asId) === 1,
|
||||||
(submit_on_adding_new_entity =
|
submit_on_adding_new_entity =
|
||||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1);
|
parseInt(el.dataset.submitOnAddingNewEntity) === 1,
|
||||||
label = el.dataset.label;
|
label = el.dataset.label;
|
||||||
|
|
||||||
if (!isMultiple) {
|
if (!isMultiple) {
|
||||||
if (input.value === "[]") {
|
if (input.value === "[]") {
|
||||||
@ -177,7 +177,7 @@ document.addEventListener("pick-entity-type-action", function (e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function (e) {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
loadDynamicPicker(document);
|
loadDynamicPicker(document);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
import { createApp } from "vue";
|
|
||||||
import OpenWopiLink from "ChillMainAssets/vuejs/_components/OpenWopiLink";
|
|
||||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
|
||||||
|
|
||||||
const i18n = _createI18n({});
|
|
||||||
|
|
||||||
//TODO move to chillDocStore or ChillWopi
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
tags to load module:
|
|
||||||
|
|
||||||
<span data-module="wopi-link"
|
|
||||||
data-wopi-url="{{ path('chill_wopi_file_edit', {'fileId': document.uuid}) }}"
|
|
||||||
data-doc-type="{{ document.type|e('html_attr') }}"
|
|
||||||
data-options="{{ options|json_encode }}"
|
|
||||||
></span>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", function (e) {
|
|
||||||
document
|
|
||||||
.querySelectorAll('span[data-module="wopi-link"]')
|
|
||||||
.forEach(function (el) {
|
|
||||||
createApp({
|
|
||||||
template:
|
|
||||||
'<open-wopi-link :wopiUrl="wopiUrl" :type="type" :options="options"></open-wopi-link>',
|
|
||||||
components: {
|
|
||||||
OpenWopiLink,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
wopiUrl: el.dataset.wopiUrl,
|
|
||||||
type: el.dataset.docType,
|
|
||||||
options:
|
|
||||||
el.dataset.options !== "null"
|
|
||||||
? JSON.parse(el.dataset.options)
|
|
||||||
: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.use(i18n)
|
|
||||||
.mount(el);
|
|
||||||
});
|
|
||||||
});
|
|
@ -45,6 +45,10 @@ const onPickGenericDoc = ({
|
|||||||
}) => {
|
}) => {
|
||||||
emit("pickGenericDoc", { genericDoc });
|
emit("pickGenericDoc", { genericDoc });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
||||||
|
emit("removeAttachment", payload);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -56,7 +60,7 @@ const onPickGenericDoc = ({
|
|||||||
></pick-generic-doc-modal>
|
></pick-generic-doc-modal>
|
||||||
<attachment-list
|
<attachment-list
|
||||||
:attachments="props.attachments"
|
:attachments="props.attachments"
|
||||||
@removeAttachment="(payload) => emit('removeAttachment', payload)"
|
@removeAttachment="onRemoveAttachment"
|
||||||
></attachment-list>
|
></attachment-list>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<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[]>(() => {
|
const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
||||||
if (false === loaded.value) {
|
if (false === loaded.value) {
|
||||||
return [];
|
return [];
|
||||||
@ -245,10 +253,8 @@ const filteredDocuments = computed<GenericDocForAccompanyingPeriod[]>(() => {
|
|||||||
:accompanying-period-id="accompanyingPeriodId"
|
:accompanying-period-id="accompanyingPeriodId"
|
||||||
:genericDoc="g"
|
:genericDoc="g"
|
||||||
:is-picked="isPicked(g)"
|
:is-picked="isPicked(g)"
|
||||||
@pickGenericDoc="(payload) => emit('pickGenericDoc', payload)"
|
@pickGenericDoc="onPickDocument"
|
||||||
@removeGenericDoc="
|
@removeGenericDoc="onRemoveGenericDoc"
|
||||||
(payload) => emit('removeGenericDoc', payload)
|
|
||||||
"
|
|
||||||
></pick-generic-doc-item>
|
></pick-generic-doc-item>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="text-center chill-no-data-statement">
|
<div v-else class="text-center chill-no-data-statement">
|
||||||
|
@ -70,7 +70,8 @@ const clickOnAddButton = () => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.item-bloc {
|
.item-bloc {
|
||||||
&.isPicked {
|
&.isPicked {
|
||||||
background: linear-gradient(
|
background:
|
||||||
|
linear-gradient(
|
||||||
180deg,
|
180deg,
|
||||||
rgba(25, 135, 84, 1) 0px,
|
rgba(25, 135, 84, 1) 0px,
|
||||||
rgba(25, 135, 84, 0) 9px
|
rgba(25, 135, 84, 0) 9px
|
||||||
|
@ -1,61 +1,66 @@
|
|||||||
<template>
|
<template>
|
||||||
<span v-if="entity.type === 'person'" class="badge rounded-pill bg-person">
|
<span
|
||||||
{{ $t("person") }}
|
v-if="props.entity.type === 'person'"
|
||||||
|
class="badge rounded-pill bg-person"
|
||||||
|
>
|
||||||
|
{{ trans(PERSON) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="entity.type === 'thirdparty'"
|
v-if="props.entity.type === 'thirdparty'"
|
||||||
class="badge rounded-pill bg-thirdparty"
|
class="badge rounded-pill bg-thirdparty"
|
||||||
>
|
>
|
||||||
<template v-if="options.displayLong !== true">
|
<template v-if="props.options.displayLong !== true">
|
||||||
{{ $t("thirdparty.thirdparty") }}
|
{{ trans(THIRDPARTY) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i class="fa fa-fw fa-user" v-if="entity.kind === 'child'" />
|
<i class="fa fa-fw fa-user" v-if="props.entity.kind === 'child'" />
|
||||||
<i
|
<i
|
||||||
class="fa fa-fw fa-hospital-o"
|
class="fa fa-fw fa-hospital-o"
|
||||||
v-else-if="entity.kind === 'company'"
|
v-else-if="props.entity.kind === 'company'"
|
||||||
/>
|
/>
|
||||||
<i class="fa fa-fw fa-user-md" v-else />
|
<i class="fa fa-fw fa-user-md" v-else />
|
||||||
|
|
||||||
<template v-if="options.displayLong === true">
|
<template v-if="props.options.displayLong === true">
|
||||||
<span v-if="entity.kind === 'child'">{{
|
<span v-if="props.entity.kind === 'child'">{{
|
||||||
$t("thirdparty.child")
|
trans(THIRDPARTY_CONTACT_OF)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else-if="entity.kind === 'company'">{{
|
<span v-else-if="props.entity.kind === 'company'">{{
|
||||||
$t("thirdparty.company")
|
trans(THIRDPARTY_A_COMPANY)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else>{{ $t("thirdparty.contact") }}</span>
|
<span v-else>{{ trans(THIRDPARTY_A_CONTACT) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span v-if="entity.type === 'user'" class="badge rounded-pill bg-user">
|
<span
|
||||||
{{ $t("user") }}
|
v-if="props.entity.type === 'user'"
|
||||||
|
class="badge rounded-pill bg-user"
|
||||||
|
>
|
||||||
|
{{ trans(ACCEPTED_USERS) }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span v-if="entity.type === 'household'" class="badge rounded-pill bg-user">
|
<span
|
||||||
{{ $t("household") }}
|
v-if="props.entity.type === 'household'"
|
||||||
|
class="badge rounded-pill bg-user"
|
||||||
|
>
|
||||||
|
{{ trans(HOUSEHOLD) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
name: "BadgeEntity",
|
trans,
|
||||||
props: ["options", "entity"],
|
HOUSEHOLD,
|
||||||
i18n: {
|
ACCEPTED_USERS,
|
||||||
messages: {
|
THIRDPARTY_A_CONTACT,
|
||||||
fr: {
|
THIRDPARTY_CONTACT_OF,
|
||||||
person: "Usager",
|
THIRDPARTY_A_COMPANY,
|
||||||
thirdparty: {
|
PERSON,
|
||||||
thirdparty: "Tiers",
|
THIRDPARTY,
|
||||||
child: "Personne de contact",
|
} from "translator";
|
||||||
company: "Personne morale",
|
|
||||||
contact: "Personne physique",
|
const props = defineProps({
|
||||||
},
|
options: Object,
|
||||||
user: "TMS",
|
entity: Object,
|
||||||
household: "Ménage",
|
});
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -66,13 +66,13 @@
|
|||||||
<div v-if="useDatePane === true" class="address-more">
|
<div v-if="useDatePane === true" class="address-more">
|
||||||
<div v-if="address.validFrom">
|
<div v-if="address.validFrom">
|
||||||
<span class="validFrom">
|
<span class="validFrom">
|
||||||
<b>{{ $t("validFrom") }}</b
|
<b>{{ trans(ADDRESS_VALID_FROM) }}</b
|
||||||
>: {{ $d(address.validFrom.date) }}
|
>: {{ $d(address.validFrom.date) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="address.validTo">
|
<div v-if="address.validTo">
|
||||||
<span class="validTo">
|
<span class="validTo">
|
||||||
<b>{{ $t("validTo") }}</b
|
<b>{{ trans(ADDRESS_VALID_TO) }}</b
|
||||||
>: {{ $d(address.validTo.date) }}
|
>: {{ $d(address.validTo.date) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -83,6 +83,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Confidential from "ChillMainAssets/vuejs/_components/Confidential.vue";
|
import Confidential from "ChillMainAssets/vuejs/_components/Confidential.vue";
|
||||||
import AddressDetailsButton from "ChillMainAssets/vuejs/_components/AddressDetails/AddressDetailsButton.vue";
|
import AddressDetailsButton from "ChillMainAssets/vuejs/_components/AddressDetails/AddressDetailsButton.vue";
|
||||||
|
import { trans, ADDRESS_VALID_FROM, ADDRESS_VALID_TO } from "translator";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddressRenderBox",
|
name: "AddressRenderBox",
|
||||||
@ -107,6 +108,9 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
return { trans, ADDRESS_VALID_FROM, ADDRESS_VALID_TO };
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
component() {
|
component() {
|
||||||
return this.isMultiline === true ? "div" : "span";
|
return this.isMultiline === true ? "div" : "span";
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
v-if="!subscriberFinal"
|
v-if="!subscriberFinal"
|
||||||
@click="subscribeTo('subscribe', 'final')"
|
@click="subscribeTo('subscribe', 'final')"
|
||||||
>
|
>
|
||||||
<i class="fa fa-check fa-fw" />
|
<i class="fa fa-check fa-fw"></i>
|
||||||
{{ $t("subscribe_final") }}
|
{{ trans(WORKFLOW_SUBSCRIBE_FINAL) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc"
|
class="btn btn-misc"
|
||||||
@ -15,8 +15,8 @@
|
|||||||
v-if="subscriberFinal"
|
v-if="subscriberFinal"
|
||||||
@click="subscribeTo('unsubscribe', 'final')"
|
@click="subscribeTo('unsubscribe', 'final')"
|
||||||
>
|
>
|
||||||
<i class="fa fa-times fa-fw" />
|
<i class="fa fa-times fa-fw"></i>
|
||||||
{{ $t("unsubscribe_final") }}
|
{{ trans(WORKFLOW_UNSUBSCRIBE_FINAL) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc"
|
class="btn btn-misc"
|
||||||
@ -24,8 +24,8 @@
|
|||||||
v-if="!subscriberStep"
|
v-if="!subscriberStep"
|
||||||
@click="subscribeTo('subscribe', 'step')"
|
@click="subscribeTo('subscribe', 'step')"
|
||||||
>
|
>
|
||||||
<i class="fa fa-check fa-fw" />
|
<i class="fa fa-check fa-fw"></i>
|
||||||
{{ $t("subscribe_all_steps") }}
|
{{ trans(WORKFLOW_SUBSCRIBE_ALL_STEPS) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc"
|
class="btn btn-misc"
|
||||||
@ -33,94 +33,55 @@
|
|||||||
v-if="subscriberStep"
|
v-if="subscriberStep"
|
||||||
@click="subscribeTo('unsubscribe', 'step')"
|
@click="subscribeTo('unsubscribe', 'step')"
|
||||||
>
|
>
|
||||||
<i class="fa fa-times fa-fw" />
|
<i class="fa fa-times fa-fw"></i>
|
||||||
{{ $t("unsubscribe_all_steps") }}
|
{{ trans(WORKFLOW_UNSUBSCRIBE_ALL_STEPS) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods.ts";
|
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods.ts";
|
||||||
|
import { defineProps, defineEmits } from "vue";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
WORKFLOW_SUBSCRIBE_FINAL,
|
||||||
|
WORKFLOW_UNSUBSCRIBE_FINAL,
|
||||||
|
WORKFLOW_SUBSCRIBE_ALL_STEPS,
|
||||||
|
WORKFLOW_UNSUBSCRIBE_ALL_STEPS,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
// props
|
||||||
name: "EntityWorkflowVueSubscriber",
|
const props = defineProps({
|
||||||
i18n: {
|
entityWorkflowId: {
|
||||||
messages: {
|
type: Number,
|
||||||
fr: {
|
required: true,
|
||||||
subscribe_final: "Recevoir une notification à l'étape finale",
|
|
||||||
unsubscribe_final:
|
|
||||||
"Ne plus recevoir de notification à l'étape finale",
|
|
||||||
subscribe_all_steps:
|
|
||||||
"Recevoir une notification à chaque étape du suivi",
|
|
||||||
unsubscribe_all_steps:
|
|
||||||
"Ne plus recevoir de notification à chaque étape du suivi",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
props: {
|
subscriberStep: {
|
||||||
entityWorkflowId: {
|
type: Boolean,
|
||||||
type: Number,
|
required: true,
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
subscriberStep: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
subscriberFinal: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
emits: ["subscriptionUpdated"],
|
subscriberFinal: {
|
||||||
methods: {
|
type: Boolean,
|
||||||
subscribeTo(step, to) {
|
required: true,
|
||||||
let params = new URLSearchParams();
|
},
|
||||||
params.set("subscribe", to);
|
});
|
||||||
|
|
||||||
const url =
|
//methods
|
||||||
`/api/1.0/main/workflow/${this.entityWorkflowId}/${step}?` +
|
const subscribeTo = (step, to) => {
|
||||||
params.toString();
|
let params = new URLSearchParams();
|
||||||
|
params.set("subscribe", to);
|
||||||
|
|
||||||
makeFetch("POST", url).then((response) => {
|
const url =
|
||||||
this.$emit("subscriptionUpdated", response);
|
`/api/1.0/main/workflow/${props.entityWorkflowId}/${step}?` +
|
||||||
});
|
params.toString();
|
||||||
},
|
|
||||||
},
|
makeFetch("POST", url).then((response) => {
|
||||||
|
emit("subscriptionUpdated", response);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
* ALTERNATIVES
|
|
||||||
*
|
|
||||||
<div class="form-check form-switch">
|
|
||||||
<input class="form-check-input" type="checkbox" role="switch" id="laststep">
|
|
||||||
<label class="form-check-label" for="laststep">{{ $t('subscribe_final') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-switch">
|
|
||||||
<input class="form-check-input" type="checkbox" role="switch" id="allsteps">
|
|
||||||
<label class="form-check-label" for="allsteps">{{ $t('subscribe_all_steps') }}</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="list-group my-3">
|
// emit
|
||||||
<label class="list-group-item">
|
const emit = defineEmits(["subscriptionUpdated"]);
|
||||||
<input class="form-check-input me-1" type="checkbox" value="">
|
|
||||||
{{ $t('subscribe_final') }}
|
|
||||||
</label>
|
|
||||||
<label class="list-group-item">
|
|
||||||
<input class="form-check-input me-1" type="checkbox" value="">
|
|
||||||
{{ $t('subscribe_all_steps') }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-group-vertical my-3" role="group">
|
|
||||||
<button type="button" class="btn btn-outline-primary">
|
|
||||||
<i class="fa fa-check fa-fw"></i>
|
|
||||||
{{ $t('subscribe_final') }}
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn btn-outline-primary">
|
|
||||||
<i class="fa fa-check fa-fw"></i>
|
|
||||||
{{ $t('subscribe_all_steps') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
*/
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex-table workflow" id="workflow-list">
|
<div class="flex-table workflow" id="workflow-list">
|
||||||
<div
|
<div
|
||||||
v-for="(w, i) in workflows"
|
v-for="(w, i) in props.workflows"
|
||||||
:key="`workflow-${i}`"
|
:key="`workflow-${i}`"
|
||||||
class="item-bloc"
|
class="item-bloc"
|
||||||
>
|
>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<span
|
<span
|
||||||
v-if="w.isOnHoldAtCurrentStep"
|
v-if="w.isOnHoldAtCurrentStep"
|
||||||
class="badge bg-success rounded-pill"
|
class="badge bg-success rounded-pill"
|
||||||
>{{ $t("on_hold") }}</span
|
>{{ trans(WORKFLOW_ON_HOLD) }}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -56,11 +56,11 @@
|
|||||||
<div class="item-col flex-grow-1">
|
<div class="item-col flex-grow-1">
|
||||||
<p v-if="isUserSubscribedToStep(w)">
|
<p v-if="isUserSubscribedToStep(w)">
|
||||||
<i class="fa fa-check fa-fw"></i>
|
<i class="fa fa-check fa-fw"></i>
|
||||||
{{ $t("you_subscribed_to_all_steps") }}
|
{{ trans(WORKFLOW_YOU_SUBSCRIBED_TO_ALL_STEPS) }}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="isUserSubscribedToFinal(w)">
|
<p v-if="isUserSubscribedToFinal(w)">
|
||||||
<i class="fa fa-check fa-fw"></i>
|
<i class="fa fa-check fa-fw"></i>
|
||||||
{{ $t("you_subscribed_to_final_step") }}
|
{{ trans(WORKFLOW_YOU_SUBSCRIBED_TO_FINAL_STEP) }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
@ -69,7 +69,7 @@
|
|||||||
<a
|
<a
|
||||||
:href="goToUrl(w)"
|
:href="goToUrl(w)"
|
||||||
class="btn btn-sm btn-show"
|
class="btn btn-sm btn-show"
|
||||||
:title="$t('action.show')"
|
:title="trans(SEE)"
|
||||||
></a>
|
></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -79,85 +79,65 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
import Popover from "bootstrap/js/src/popover";
|
import Popover from "bootstrap/js/src/popover";
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
BY_USER,
|
||||||
|
SEE,
|
||||||
|
WORKFLOW_YOU_SUBSCRIBED_TO_ALL_STEPS,
|
||||||
|
WORKFLOW_YOU_SUBSCRIBED_TO_FINAL_STEP,
|
||||||
|
WORKFLOW_ON_HOLD,
|
||||||
|
WORKFLOW_AT,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
const i18n = {
|
// props
|
||||||
messages: {
|
const props = defineProps({
|
||||||
fr: {
|
workflows: {
|
||||||
you_subscribed_to_all_steps:
|
type: Array,
|
||||||
"Vous recevrez une notification à chaque étape",
|
required: true,
|
||||||
you_subscribed_to_final_step:
|
|
||||||
"Vous recevrez une notification à l'étape finale",
|
|
||||||
by: "Par",
|
|
||||||
at: "Le",
|
|
||||||
on_hold: "En attente",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// methods
|
||||||
|
const goToUrl = (w) => `/fr/main/workflow/${w.id}/show`;
|
||||||
|
const getPopTitle = (step) => {
|
||||||
|
if (step.transitionPrevious != null) {
|
||||||
|
//console.log(step.transitionPrevious.text);
|
||||||
|
let freezed = step.isFreezed
|
||||||
|
? `<i class="fa fa-snowflake-o fa-sm me-1"></i>`
|
||||||
|
: ``;
|
||||||
|
return `${freezed}${step.transitionPrevious.text}`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
const getPopContent = (step) => {
|
||||||
|
if (step.transitionPrevious != null) {
|
||||||
|
if (step.transitionPreviousBy !== null) {
|
||||||
|
return `<ul class="small_in_title">
|
||||||
|
<li><span class="item-key">${trans(BY_USER)} : </span><b>${step.transitionPreviousBy.text}</b></li>
|
||||||
|
<li><span class="item-key">${trans(WORKFLOW_AT)} : </span><b>${formatDate(step.transitionPreviousAt.datetime)}</b></li>
|
||||||
|
</ul>`;
|
||||||
|
} else {
|
||||||
|
return `<ul class="small_in_title">
|
||||||
|
<li><span class="item-key">${trans(WORKFLOW_AT)} : </span><b>${formatDate(step.transitionPreviousAt.datetime)}</b></li>
|
||||||
|
</ul>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const formatDate = (datetime) =>
|
||||||
|
datetime.split("T")[0] + " " + datetime.split("T")[1].substring(0, 5);
|
||||||
|
const isUserSubscribedToStep = () => false;
|
||||||
|
const isUserSubscribedToFinal = () => false;
|
||||||
|
|
||||||
export default {
|
onMounted(() => {
|
||||||
name: "ListWorkflow",
|
const triggerList = [].slice.call(
|
||||||
i18n: i18n,
|
document.querySelectorAll('[data-bs-toggle="popover"]'),
|
||||||
props: {
|
);
|
||||||
workflows: {
|
triggerList.map(function (el) {
|
||||||
type: Array,
|
return new Popover(el, {
|
||||||
required: true,
|
html: true,
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goToUrl(w) {
|
|
||||||
return `/fr/main/workflow/${w.id}/show`;
|
|
||||||
},
|
|
||||||
getPopTitle(step) {
|
|
||||||
if (step.transitionPrevious != null) {
|
|
||||||
//console.log(step.transitionPrevious.text);
|
|
||||||
let freezed = step.isFreezed
|
|
||||||
? `<i class="fa fa-snowflake-o fa-sm me-1"></i>`
|
|
||||||
: ``;
|
|
||||||
return `${freezed}${step.transitionPrevious.text}`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getPopContent(step) {
|
|
||||||
if (step.transitionPrevious != null) {
|
|
||||||
if (step.transitionPreviousBy !== null) {
|
|
||||||
return `<ul class="small_in_title">
|
|
||||||
<li><span class="item-key">${i18n.messages.fr.by} : </span><b>${step.transitionPreviousBy.text}</b></li>
|
|
||||||
<li><span class="item-key">${i18n.messages.fr.at} : </span><b>${this.formatDate(step.transitionPreviousAt.datetime)}</b></li>
|
|
||||||
</ul>`;
|
|
||||||
} else {
|
|
||||||
return `<ul class="small_in_title">
|
|
||||||
<li><span class="item-key">${i18n.messages.fr.at} : </span><b>${this.formatDate(step.transitionPreviousAt.datetime)}</b></li>
|
|
||||||
</ul>`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatDate(datetime) {
|
|
||||||
return (
|
|
||||||
datetime.split("T")[0] +
|
|
||||||
" " +
|
|
||||||
datetime.split("T")[1].substring(0, 5)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
isUserSubscribedToStep(w) {
|
|
||||||
// todo
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
isUserSubscribedToFinal(w) {
|
|
||||||
// todo
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const triggerList = [].slice.call(
|
|
||||||
document.querySelectorAll('[data-bs-toggle="popover"]'),
|
|
||||||
);
|
|
||||||
const popoverList = triggerList.map(function (el) {
|
|
||||||
//console.log('popover', el)
|
|
||||||
return new Popover(el, {
|
|
||||||
html: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
};
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<pick-workflow
|
<Pick-workflow
|
||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="props.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="props.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="props.workflowsAvailables"
|
||||||
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
|
:preventDefaultMoveToGenerate="props.preventDefaultMoveToGenerate"
|
||||||
:goToGenerateWorkflowPayload="this.goToGenerateWorkflowPayload"
|
:goToGenerateWorkflowPayload="props.goToGenerateWorkflowPayload"
|
||||||
:countExistingWorkflows="countWorkflows"
|
:countExistingWorkflows="countWorkflows"
|
||||||
|
:embedded-within-list-modal="false"
|
||||||
@go-to-generate-workflow="goToGenerateWorkflow"
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
@click-open-list="openModal"
|
@click-open-list="openModal"
|
||||||
></pick-workflow>
|
></Pick-workflow>
|
||||||
|
|
||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
<modal
|
<Modal
|
||||||
v-if="modal.showModal"
|
v-if="modal.showModal"
|
||||||
:modalDialogClass="modal.modalDialogClass"
|
:modalDialogClass="modal.modalDialogClass"
|
||||||
@close="modal.showModal = false"
|
@close="modal.showModal = false"
|
||||||
>
|
>
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h2 class="modal-title">{{ $t("workflow_list") }}</h2>
|
<h2 class="modal-title">{{ trans(WORKFLOW_LIST) }}</h2>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
@ -27,103 +28,80 @@
|
|||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<pick-workflow
|
<pick-workflow
|
||||||
v-if="allowCreate"
|
v-if="allowCreate"
|
||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="props.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="props.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="props.workflowsAvailables"
|
||||||
:preventDefaultMoveToGenerate="
|
:preventDefaultMoveToGenerate="
|
||||||
this.$props.preventDefaultMoveToGenerate
|
props.preventDefaultMoveToGenerate
|
||||||
"
|
"
|
||||||
:goToGenerateWorkflowPayload="
|
:goToGenerateWorkflowPayload="
|
||||||
this.goToGenerateWorkflowPayload
|
props.goToGenerateWorkflowPayload
|
||||||
"
|
"
|
||||||
:countExistingWorkflows="countWorkflows"
|
:countExistingWorkflows="countWorkflows"
|
||||||
:embedded-within-list-modal="true"
|
:embedded-within-list-modal="true"
|
||||||
@go-to-generate-workflow="this.goToGenerateWorkflow"
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</Modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
|
import { ref, computed, defineProps, defineEmits } from "vue";
|
||||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||||
import PickWorkflow from "ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue";
|
import PickWorkflow from "ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue";
|
||||||
import ListWorkflowVue from "ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflow.vue";
|
import ListWorkflowVue from "ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflow.vue";
|
||||||
|
import { trans, WORKFLOW_LIST } from "translator";
|
||||||
|
|
||||||
export default {
|
// Define props
|
||||||
name: "ListWorkflowModal",
|
const props = defineProps({
|
||||||
components: {
|
workflows: {
|
||||||
Modal,
|
type: Array,
|
||||||
PickWorkflow,
|
required: true,
|
||||||
ListWorkflowVue,
|
|
||||||
},
|
},
|
||||||
emits: ["goToGenerateWorkflow"],
|
allowCreate: {
|
||||||
props: {
|
type: Boolean,
|
||||||
workflows: {
|
required: true,
|
||||||
type: Array,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
allowCreate: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
relatedEntityClass: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
relatedEntityId: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
workflowsAvailables: {
|
|
||||||
type: Array,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
preventDefaultMoveToGenerate: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
goToGenerateWorkflowPayload: {
|
|
||||||
required: false,
|
|
||||||
default: {},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
relatedEntityClass: {
|
||||||
return {
|
type: String,
|
||||||
modal: {
|
required: true,
|
||||||
showModal: false,
|
|
||||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
relatedEntityId: {
|
||||||
countWorkflows() {
|
type: Number,
|
||||||
return this.workflows.length;
|
required: false,
|
||||||
},
|
|
||||||
hasWorkflow() {
|
|
||||||
return this.countWorkflows > 0;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
workflowsAvailables: {
|
||||||
openModal() {
|
type: Array,
|
||||||
this.modal.showModal = true;
|
required: true,
|
||||||
},
|
|
||||||
goToGenerateWorkflow(data) {
|
|
||||||
console.log("go to generate workflow intercepted", data);
|
|
||||||
this.$emit("goToGenerateWorkflow", data);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
i18n: {
|
preventDefaultMoveToGenerate: {
|
||||||
messages: {
|
type: Boolean,
|
||||||
fr: {
|
required: false,
|
||||||
workflow_list: "Liste des workflows associés",
|
default: false,
|
||||||
workflow: " workflow associé",
|
|
||||||
workflows: " workflows associés",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
goToGenerateWorkflowPayload: {
|
||||||
|
required: false,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Define emits
|
||||||
|
const emit = defineEmits(["goToGenerateWorkflow"]);
|
||||||
|
|
||||||
|
// Reactive data
|
||||||
|
const modal = ref({
|
||||||
|
showModal: false,
|
||||||
|
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Computed properties
|
||||||
|
const countWorkflows = computed(() => props.workflows.length);
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
const openModal = () => (modal.value.showModal = true);
|
||||||
|
|
||||||
|
const goToGenerateWorkflow = (data) => emit("goToGenerateWorkflow", data);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -8,28 +8,28 @@
|
|||||||
aria-modal="true"
|
aria-modal="true"
|
||||||
role="dialog"
|
role="dialog"
|
||||||
>
|
>
|
||||||
<div class="modal-dialog" :class="modalDialogClass">
|
<div class="modal-dialog" :class="props.modalDialogClass || {}">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<slot name="header" />
|
<slot name="header"></slot>
|
||||||
<button class="close btn" @click="$emit('close')">
|
<button class="close btn" @click="emits('close')">
|
||||||
<i class="fa fa-times" aria-hidden="true" />
|
<i class="fa fa-times" aria-hidden="true"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="body-head">
|
<div class="body-head">
|
||||||
<slot name="body-head" />
|
<slot name="body-head"></slot>
|
||||||
</div>
|
</div>
|
||||||
<slot name="body" />
|
<slot name="body"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer" v-if="!hideFooter">
|
<div class="modal-footer" v-if="!hideFooter">
|
||||||
<button
|
<button
|
||||||
class="btn btn-cancel"
|
class="btn btn-cancel"
|
||||||
@click="$emit('close')"
|
@click="emits('close')"
|
||||||
>
|
>
|
||||||
{{ $t("action.close") }}
|
{{ trans(MODAL_ACTION_CLOSE) }}
|
||||||
</button>
|
</button>
|
||||||
<slot name="footer" />
|
<slot name="footer"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -39,8 +39,7 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from "vue";
|
|
||||||
/*
|
/*
|
||||||
* This Modal component is a mix between Vue3 modal implementation
|
* This Modal component is a mix between Vue3 modal implementation
|
||||||
* [+] with 'v-if:showModal' directive:parameter, html scope is added/removed not just shown/hidden
|
* [+] with 'v-if:showModal' directive:parameter, html scope is added/removed not just shown/hidden
|
||||||
@ -50,22 +49,23 @@ import { defineComponent } from "vue";
|
|||||||
* [+] using bootstrap css classes, the modal have a responsive behaviour,
|
* [+] using bootstrap css classes, the modal have a responsive behaviour,
|
||||||
* [+] modal design can be configured using css classes (size, scroll)
|
* [+] modal design can be configured using css classes (size, scroll)
|
||||||
*/
|
*/
|
||||||
export default defineComponent({
|
import { trans, MODAL_ACTION_CLOSE } from "translator";
|
||||||
name: "Modal",
|
import { defineProps } from "vue";
|
||||||
props: {
|
|
||||||
modalDialogClass: {
|
export interface ModalProps {
|
||||||
type: Object,
|
modalDialogClass: object | null;
|
||||||
required: false,
|
hideFooter: boolean;
|
||||||
default: {},
|
}
|
||||||
},
|
|
||||||
hideFooter: {
|
// Define the props
|
||||||
type: Boolean,
|
const props = withDefaults(defineProps<ModalProps>(), {
|
||||||
required: false,
|
hideFooter: false,
|
||||||
default: false,
|
modalDialogClass: null,
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ["close"],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits<{
|
||||||
|
close: [];
|
||||||
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
class="btn"
|
class="btn"
|
||||||
:class="overrideClass"
|
:class="overrideClass"
|
||||||
type="button"
|
type="button"
|
||||||
:title="$t('markAsUnread')"
|
:title="trans(NOTIFICATION_MARK_AS_UNREAD)"
|
||||||
@click="markAsUnread"
|
@click="markAsUnread"
|
||||||
>
|
>
|
||||||
<i class="fa fa-sm fa-envelope-o" />
|
<i class="fa fa-sm fa-envelope-o"></i>
|
||||||
<span v-if="!buttonNoText" class="ps-2">
|
<span v-if="!props.buttonNoText" class="ps-2">
|
||||||
{{ $t("markAsUnread") }}
|
{{ trans(NOTIFICATION_MARK_AS_UNREAD) }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@ -23,12 +23,12 @@
|
|||||||
class="btn"
|
class="btn"
|
||||||
:class="overrideClass"
|
:class="overrideClass"
|
||||||
type="button"
|
type="button"
|
||||||
:title="$t('markAsRead')"
|
:title="trans(NOTIFICATION_MARK_AS_READ)"
|
||||||
@click="markAsRead"
|
@click="markAsRead"
|
||||||
>
|
>
|
||||||
<i class="fa fa-sm fa-envelope-open-o" />
|
<i class="fa fa-sm fa-envelope-open-o"></i>
|
||||||
<span v-if="!buttonNoText" class="ps-2">
|
<span v-if="!buttonNoText" class="ps-2">
|
||||||
{{ $t("markAsRead") }}
|
{{ trans(NOTIFICATION_MARK_AS_READ) }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@ -37,9 +37,9 @@
|
|||||||
type="button"
|
type="button"
|
||||||
class="btn btn-outline-primary"
|
class="btn btn-outline-primary"
|
||||||
:href="showUrl"
|
:href="showUrl"
|
||||||
:title="$t('action.show')"
|
:title="trans(SEE)"
|
||||||
>
|
>
|
||||||
<i class="fa fa-sm fa-comment-o" />
|
<i class="fa fa-sm fa-comment-o"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- "Mark All Read" button -->
|
<!-- "Mark All Read" button -->
|
||||||
@ -51,7 +51,7 @@
|
|||||||
:title="$t('markAllRead')"
|
:title="$t('markAllRead')"
|
||||||
@click="markAllRead"
|
@click="markAllRead"
|
||||||
>
|
>
|
||||||
<i class="fa fa-sm fa-envelope-o" />
|
<i class="fa fa-sm fa-envelope-o"></i>
|
||||||
<span v-if="!buttonNoText" class="ps-2">
|
<span v-if="!buttonNoText" class="ps-2">
|
||||||
{{ $t("markAllRead") }}
|
{{ $t("markAllRead") }}
|
||||||
</span>
|
</span>
|
||||||
@ -59,89 +59,66 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
|
import { computed } from "vue";
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods.ts";
|
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods.ts";
|
||||||
|
import {
|
||||||
|
trans,
|
||||||
|
NOTIFICATION_MARK_AS_READ,
|
||||||
|
NOTIFICATION_MARK_AS_UNREAD,
|
||||||
|
SEE,
|
||||||
|
} from "translator";
|
||||||
|
|
||||||
export default {
|
// Props
|
||||||
name: "NotificationReadToggle",
|
const props = defineProps({
|
||||||
props: {
|
isRead: {
|
||||||
isRead: {
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
notificationId: {
|
|
||||||
required: true,
|
|
||||||
type: Number,
|
|
||||||
},
|
|
||||||
// Optional
|
|
||||||
buttonClass: {
|
|
||||||
required: false,
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
buttonNoText: {
|
|
||||||
required: false,
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
showUrl: {
|
|
||||||
required: false,
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
emits: ["markRead", "markUnread"],
|
notificationId: {
|
||||||
computed: {
|
type: Number,
|
||||||
/// [Option] override default button appearance (btn-misc)
|
required: true,
|
||||||
overrideClass() {
|
|
||||||
return this.buttonClass ? this.buttonClass : "btn-misc";
|
|
||||||
},
|
|
||||||
/// [Option] don't display text on button
|
|
||||||
buttonHideText() {
|
|
||||||
return this.buttonNoText;
|
|
||||||
},
|
|
||||||
/// [Option] showUrl is href for show page second button.
|
|
||||||
// When passed, the component return a button-group with 2 buttons.
|
|
||||||
isButtonGroup() {
|
|
||||||
return this.showUrl;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
buttonClass: {
|
||||||
markAsUnread() {
|
type: String,
|
||||||
makeFetch(
|
required: false,
|
||||||
"POST",
|
|
||||||
`/api/1.0/main/notification/${this.notificationId}/mark/unread`,
|
|
||||||
[],
|
|
||||||
).then(() => {
|
|
||||||
this.$emit("markRead", { notificationId: this.notificationId });
|
|
||||||
});
|
|
||||||
},
|
|
||||||
markAsRead() {
|
|
||||||
makeFetch(
|
|
||||||
"POST",
|
|
||||||
`/api/1.0/main/notification/${this.notificationId}/mark/read`,
|
|
||||||
[],
|
|
||||||
).then(() => {
|
|
||||||
this.$emit("markUnread", {
|
|
||||||
notificationId: this.notificationId,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
markAllRead() {
|
|
||||||
makeFetch(
|
|
||||||
"POST",
|
|
||||||
`/api/1.0/main/notification/markallread`,
|
|
||||||
[],
|
|
||||||
).then(() => {
|
|
||||||
this.$emit("markAllRead");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
i18n: {
|
buttonNoText: {
|
||||||
messages: {
|
type: Boolean,
|
||||||
fr: {
|
required: false,
|
||||||
markAsUnread: "Marquer comme non-lu",
|
|
||||||
markAsRead: "Marquer comme lu",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
showUrl: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Emits
|
||||||
|
const emit = defineEmits(["markRead", "markUnread"]);
|
||||||
|
|
||||||
|
// Computed
|
||||||
|
const overrideClass = computed(() => props.buttonClass || "btn-misc");
|
||||||
|
const isButtonGroup = computed(() => props.showUrl);
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
const markAsUnread = () => {
|
||||||
|
makeFetch(
|
||||||
|
"POST",
|
||||||
|
`/api/1.0/main/notification/${props.notificationId}/mark/unread`,
|
||||||
|
[],
|
||||||
|
).then(() => {
|
||||||
|
emit("markRead", { notificationId: props.notificationId });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const markAsRead = () => {
|
||||||
|
makeFetch(
|
||||||
|
"POST",
|
||||||
|
`/api/1.0/main/notification/${props.notificationId}/mark/read`,
|
||||||
|
[],
|
||||||
|
).then(() => {
|
||||||
|
emit("markUnread", { notificationId: props.notificationId });
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,253 +0,0 @@
|
|||||||
<template>
|
|
||||||
<a
|
|
||||||
v-if="isOpenDocument"
|
|
||||||
class="btn"
|
|
||||||
:class="[
|
|
||||||
isChangeIcon ? 'change-icon' : '',
|
|
||||||
isChangeClass ? options.changeClass : 'btn-wopilink',
|
|
||||||
]"
|
|
||||||
@click="openModal"
|
|
||||||
>
|
|
||||||
<i v-if="isChangeIcon" class="fa me-2" :class="options.changeIcon" />
|
|
||||||
|
|
||||||
<span v-if="!noText">
|
|
||||||
{{ $t("online_edit_document") }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<teleport to="body">
|
|
||||||
<div class="wopi-frame" v-if="isOpenDocument">
|
|
||||||
<modal
|
|
||||||
v-if="modal.showModal"
|
|
||||||
:modal-dialog-class="modal.modalDialogClass"
|
|
||||||
:hide-footer="true"
|
|
||||||
@close="modal.showModal = false"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<img class="logo" :src="logo" height="45" />
|
|
||||||
<span class="ms-auto me-3">
|
|
||||||
<span v-if="options.title">{{ options.title }}</span>
|
|
||||||
</span>
|
|
||||||
<!--
|
|
||||||
<a class="btn btn-outline-light">
|
|
||||||
<i class="fa fa-save fa-fw"></i>
|
|
||||||
{{ $t('save_and_quit') }}
|
|
||||||
</a>
|
|
||||||
-->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #body>
|
|
||||||
<div v-if="loading" class="loading">
|
|
||||||
<i
|
|
||||||
class="fa fa-circle-o-notch fa-spin fa-3x"
|
|
||||||
:title="$t('loading')"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<iframe :src="this.wopiUrl" @load="loaded" />
|
|
||||||
</template>
|
|
||||||
</modal>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<modal
|
|
||||||
v-if="modal.showModal"
|
|
||||||
modal-dialog-class="modal-sm"
|
|
||||||
@close="modal.showModal = false"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<h3>{{ $t("invalid_title") }}</h3>
|
|
||||||
</template>
|
|
||||||
<template #body>
|
|
||||||
<div class="alert alert-warning">
|
|
||||||
{{ $t("invalid_message") }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</modal>
|
|
||||||
</div>
|
|
||||||
</teleport>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
|
||||||
import logo from "ChillMainAssets/chill/img/logo-chill-sans-slogan_white.png";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "OpenWopiLink",
|
|
||||||
components: {
|
|
||||||
Modal,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
wopiUrl: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
type: Object,
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
modal: {
|
|
||||||
showModal: false,
|
|
||||||
modalDialogClass: "modal-fullscreen", //modal-dialog-scrollable
|
|
||||||
},
|
|
||||||
logo: logo,
|
|
||||||
loading: false,
|
|
||||||
mime: [
|
|
||||||
// TODO temporary hardcoded. to be replaced by twig extension or a collabora server query
|
|
||||||
"application/clarisworks",
|
|
||||||
"application/coreldraw",
|
|
||||||
"application/macwriteii",
|
|
||||||
"application/msword",
|
|
||||||
"application/pdf",
|
|
||||||
"application/vnd.lotus-1-2-3",
|
|
||||||
"application/vnd.ms-excel",
|
|
||||||
"application/vnd.ms-excel.sheet.binary.macroEnabled.12",
|
|
||||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
||||||
"application/vnd.ms-excel.template.macroEnabled.12",
|
|
||||||
"application/vnd.ms-powerpoint",
|
|
||||||
"application/vnd.ms-powerpoint.presentation.macroEnabled.12",
|
|
||||||
"application/vnd.ms-powerpoint.template.macroEnabled.12",
|
|
||||||
"application/vnd.ms-visio.drawing",
|
|
||||||
"application/vnd.ms-word.document.macroEnabled.12",
|
|
||||||
"application/vnd.ms-word.template.macroEnabled.12",
|
|
||||||
"application/vnd.ms-works",
|
|
||||||
"application/vnd.oasis.opendocument.chart",
|
|
||||||
"application/vnd.oasis.opendocument.formula",
|
|
||||||
"application/vnd.oasis.opendocument.graphics",
|
|
||||||
"application/vnd.oasis.opendocument.graphics-flat-xml",
|
|
||||||
"application/vnd.oasis.opendocument.graphics-template",
|
|
||||||
"application/vnd.oasis.opendocument.presentation",
|
|
||||||
"application/vnd.oasis.opendocument.presentation-flat-xml",
|
|
||||||
"application/vnd.oasis.opendocument.presentation-template",
|
|
||||||
"application/vnd.oasis.opendocument.spreadsheet",
|
|
||||||
"application/vnd.oasis.opendocument.spreadsheet-flat-xml",
|
|
||||||
"application/vnd.oasis.opendocument.spreadsheet-template",
|
|
||||||
"application/vnd.oasis.opendocument.text",
|
|
||||||
"application/vnd.oasis.opendocument.text-flat-xml",
|
|
||||||
"application/vnd.oasis.opendocument.text-master",
|
|
||||||
"application/vnd.oasis.opendocument.text-master-template",
|
|
||||||
"application/vnd.oasis.opendocument.text-template",
|
|
||||||
"application/vnd.oasis.opendocument.text-web",
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.slideshow",
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
|
|
||||||
"application/vnd.sun.xml.calc",
|
|
||||||
"application/vnd.sun.xml.calc.template",
|
|
||||||
"application/vnd.sun.xml.chart",
|
|
||||||
"application/vnd.sun.xml.draw",
|
|
||||||
"application/vnd.sun.xml.draw.template",
|
|
||||||
"application/vnd.sun.xml.impress",
|
|
||||||
"application/vnd.sun.xml.impress.template",
|
|
||||||
"application/vnd.sun.xml.math",
|
|
||||||
"application/vnd.sun.xml.writer",
|
|
||||||
"application/vnd.sun.xml.writer.global",
|
|
||||||
"application/vnd.sun.xml.writer.template",
|
|
||||||
"application/vnd.visio",
|
|
||||||
"application/vnd.visio2013",
|
|
||||||
"application/vnd.wordperfect",
|
|
||||||
"application/x-abiword",
|
|
||||||
"application/x-aportisdoc",
|
|
||||||
"application/x-dbase",
|
|
||||||
"application/x-dif-document",
|
|
||||||
"application/x-fictionbook+xml",
|
|
||||||
"application/x-gnumeric",
|
|
||||||
"application/x-hwp",
|
|
||||||
"application/x-iwork-keynote-sffkey",
|
|
||||||
"application/x-iwork-numbers-sffnumbers",
|
|
||||||
"application/x-iwork-pages-sffpages",
|
|
||||||
"application/x-mspublisher",
|
|
||||||
"application/x-mswrite",
|
|
||||||
"application/x-pagemaker",
|
|
||||||
"application/x-sony-bbeb",
|
|
||||||
"application/x-t602",
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isOpenDocument() {
|
|
||||||
if (this.mime.indexOf(this.type) !== -1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
noText() {
|
|
||||||
if (typeof this.options.noText !== "undefined") {
|
|
||||||
return this.options.noText === true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
isChangeIcon() {
|
|
||||||
if (typeof this.options.changeIcon !== "undefined") {
|
|
||||||
return !(
|
|
||||||
this.options.changeIcon === null ||
|
|
||||||
this.options.changeIcon === ""
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
isChangeClass() {
|
|
||||||
if (typeof this.options.changeClass !== "undefined") {
|
|
||||||
return !(
|
|
||||||
this.options.changeClass === null ||
|
|
||||||
this.options.changeClass === ""
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openModal() {
|
|
||||||
this.loading = true;
|
|
||||||
this.modal.showModal = true;
|
|
||||||
},
|
|
||||||
loaded() {
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
i18n: {
|
|
||||||
messages: {
|
|
||||||
fr: {
|
|
||||||
online_edit_document: "Éditer en ligne",
|
|
||||||
save_and_quit: "Enregistrer et quitter",
|
|
||||||
loading: "Chargement de l'éditeur en ligne",
|
|
||||||
invalid_title: "Format incompatible",
|
|
||||||
invalid_message:
|
|
||||||
"Désolé, ce format de document n'est pas éditable en ligne.",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
div.wopi-frame {
|
|
||||||
div.modal-header {
|
|
||||||
border-bottom: 0;
|
|
||||||
background-color: var(--bs-primary);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
div.modal-body {
|
|
||||||
padding: 0;
|
|
||||||
overflow-y: unset !important;
|
|
||||||
iframe {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
div.loading {
|
|
||||||
position: absolute;
|
|
||||||
color: var(--bs-chill-gray);
|
|
||||||
top: calc(50% - 30px);
|
|
||||||
left: calc(50% - 30px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -136,6 +136,59 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<h2>Wrap-list</h2>
|
||||||
<p>Une liste inline qui s'aligne, puis glisse sous son titre.</p>
|
<p>Une liste inline qui s'aligne, puis glisse sous son titre.</p>
|
||||||
<div class="wrap-list debug">
|
<div class="wrap-list debug">
|
||||||
@ -392,4 +445,12 @@ Toutes les classes btn-* de bootstrap sont fonctionnelles
|
|||||||
</div>
|
</div>
|
||||||
</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 %}
|
{% endblock %}
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||||
{{ encore_entry_script_tags('mod_entity_workflow_subscribe') }}
|
{{ encore_entry_script_tags('mod_entity_workflow_subscribe') }}
|
||||||
{{ encore_entry_script_tags('page_workflow_show') }}
|
{{ encore_entry_script_tags('page_workflow_show') }}
|
||||||
{{ encore_entry_script_tags('mod_wopi_link') }}
|
|
||||||
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{{ encore_entry_script_tags('mod_workflow_attachment') }}
|
{{ encore_entry_script_tags('mod_workflow_attachment') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -19,7 +18,6 @@
|
|||||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||||
{{ encore_entry_link_tags('mod_entity_workflow_subscribe') }}
|
{{ encore_entry_link_tags('mod_entity_workflow_subscribe') }}
|
||||||
{{ encore_entry_link_tags('page_workflow_show') }}
|
{{ encore_entry_link_tags('page_workflow_show') }}
|
||||||
{{ encore_entry_link_tags('mod_wopi_link') }}
|
|
||||||
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{{ encore_entry_link_tags('mod_workflow_attachment') }}
|
{{ encore_entry_link_tags('mod_workflow_attachment') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -34,6 +34,7 @@ class GenderDocGenNormalizer implements ContextAwareNormalizerInterface, Normali
|
|||||||
'id' => $gender->getId(),
|
'id' => $gender->getId(),
|
||||||
'label' => $this->translatableStringHelper->localize($gender->getLabel()),
|
'label' => $this->translatableStringHelper->localize($gender->getLabel()),
|
||||||
'genderTranslation' => $gender->getGenderTranslation(),
|
'genderTranslation' => $gender->getGenderTranslation(),
|
||||||
|
'type' => 'chill_main_gender',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,8 @@ class AddressReferenceBEFromBestAddress
|
|||||||
$csv->setDelimiter(',');
|
$csv->setDelimiter(',');
|
||||||
$csv->setHeaderOffset(0);
|
$csv->setHeaderOffset(0);
|
||||||
|
|
||||||
$stmt = Statement::create()
|
$stmt = new Statement();
|
||||||
->process($csv);
|
$stmt = $stmt->process($csv);
|
||||||
|
|
||||||
foreach ($stmt as $record) {
|
foreach ($stmt as $record) {
|
||||||
$this->baseImporter->importAddress(
|
$this->baseImporter->importAddress(
|
||||||
|
@ -55,32 +55,32 @@ class AddressReferenceFromBAN
|
|||||||
|
|
||||||
$csv = Reader::createFromStream($csvDecompressed);
|
$csv = Reader::createFromStream($csvDecompressed);
|
||||||
$csv->setDelimiter(';')->setHeaderOffset(0);
|
$csv->setDelimiter(';')->setHeaderOffset(0);
|
||||||
$stmt = Statement::create()
|
$stmt = new Statement();
|
||||||
->process($csv, [
|
$stmt = $stmt->process($csv, [
|
||||||
'id',
|
'id',
|
||||||
'id_fantoir',
|
'id_fantoir',
|
||||||
'numero',
|
'numero',
|
||||||
'rep',
|
'rep',
|
||||||
'nom_voie',
|
'nom_voie',
|
||||||
'code_postal',
|
'code_postal',
|
||||||
'code_insee',
|
'code_insee',
|
||||||
'nom_commune',
|
'nom_commune',
|
||||||
'code_insee_ancienne_commune',
|
'code_insee_ancienne_commune',
|
||||||
'nom_ancienne_commune',
|
'nom_ancienne_commune',
|
||||||
'x',
|
'x',
|
||||||
'y',
|
'y',
|
||||||
'lon',
|
'lon',
|
||||||
'lat',
|
'lat',
|
||||||
'type_position',
|
'type_position',
|
||||||
'alias',
|
'alias',
|
||||||
'nom_ld',
|
'nom_ld',
|
||||||
'libelle_acheminement',
|
'libelle_acheminement',
|
||||||
'nom_afnor',
|
'nom_afnor',
|
||||||
'source_position',
|
'source_position',
|
||||||
'source_nom_voie',
|
'source_nom_voie',
|
||||||
'certification_commune',
|
'certification_commune',
|
||||||
'cad_parcelles',
|
'cad_parcelles',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
foreach ($stmt as $record) {
|
foreach ($stmt as $record) {
|
||||||
$this->baseImporter->importAddress(
|
$this->baseImporter->importAddress(
|
||||||
|
@ -43,17 +43,17 @@ class AddressReferenceFromBano
|
|||||||
|
|
||||||
$csv = Reader::createFromStream($file);
|
$csv = Reader::createFromStream($file);
|
||||||
$csv->setDelimiter(',');
|
$csv->setDelimiter(',');
|
||||||
$stmt = Statement::create()
|
$stmt = new Statement();
|
||||||
->process($csv, [
|
$stmt = $stmt->process($csv, [
|
||||||
'refId',
|
'refId',
|
||||||
'streetNumber',
|
'streetNumber',
|
||||||
'street',
|
'street',
|
||||||
'postcode',
|
'postcode',
|
||||||
'city',
|
'city',
|
||||||
'_o',
|
'_o',
|
||||||
'lat',
|
'lat',
|
||||||
'lon',
|
'lon',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
foreach ($stmt as $record) {
|
foreach ($stmt as $record) {
|
||||||
$this->baseImporter->importAddress(
|
$this->baseImporter->importAddress(
|
||||||
|
@ -54,7 +54,8 @@ class AddressReferenceLU
|
|||||||
|
|
||||||
private function process_address(Reader $csv, ?string $sendAddressReportToEmail = null): void
|
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) {
|
foreach ($stmt as $record) {
|
||||||
$this->addressBaseImporter->importAddress(
|
$this->addressBaseImporter->importAddress(
|
||||||
$record['id_geoportail'],
|
$record['id_geoportail'],
|
||||||
@ -74,7 +75,8 @@ class AddressReferenceLU
|
|||||||
|
|
||||||
private function process_postal_code(Reader $csv): void
|
private function process_postal_code(Reader $csv): void
|
||||||
{
|
{
|
||||||
$stmt = Statement::create()->process($csv);
|
$stmt = new Statement();
|
||||||
|
$stmt = $stmt->process($csv);
|
||||||
$arr_postal_codes = [];
|
$arr_postal_codes = [];
|
||||||
foreach ($stmt as $record) {
|
foreach ($stmt as $record) {
|
||||||
if (false === \array_key_exists($record['code_postal'], $arr_postal_codes)) {
|
if (false === \array_key_exists($record['code_postal'], $arr_postal_codes)) {
|
||||||
|
@ -25,6 +25,8 @@ use Symfony\Component\Workflow\Transition;
|
|||||||
#[AsMessageHandler]
|
#[AsMessageHandler]
|
||||||
final readonly class CancelStaleWorkflowHandler
|
final readonly class CancelStaleWorkflowHandler
|
||||||
{
|
{
|
||||||
|
private const LOG_PREFIX = '[CancelStaleWorkflowHandler] ';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private EntityWorkflowRepository $workflowRepository,
|
private EntityWorkflowRepository $workflowRepository,
|
||||||
private Registry $registry,
|
private Registry $registry,
|
||||||
@ -40,13 +42,13 @@ final readonly class CancelStaleWorkflowHandler
|
|||||||
|
|
||||||
$workflow = $this->workflowRepository->find($message->getWorkflowId());
|
$workflow = $this->workflowRepository->find($message->getWorkflowId());
|
||||||
if (null === $workflow) {
|
if (null === $workflow) {
|
||||||
$this->logger->alert('Workflow was not found!', [$workflowId]);
|
$this->logger->alert(self::LOG_PREFIX.'Workflow was not found!', ['entityWorkflowId' => $workflowId]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $workflow->isStaledAt($olderThanDate)) {
|
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');
|
throw new UnrecoverableMessageHandlingException('the workflow is not staled any more');
|
||||||
}
|
}
|
||||||
@ -67,14 +69,14 @@ final readonly class CancelStaleWorkflowHandler
|
|||||||
'transitionAt' => $this->clock->now(),
|
'transitionAt' => $this->clock->now(),
|
||||||
'transition' => $transition->getName(),
|
'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;
|
$transitionApplied = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$transitionApplied) {
|
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));
|
throw new UnrecoverableMessageHandlingException(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ final class GenderDocGenNormalizerTest extends TestCase
|
|||||||
'id' => 1,
|
'id' => 1,
|
||||||
'label' => 'homme',
|
'label' => 'homme',
|
||||||
'genderTranslation' => GenderEnum::MALE,
|
'genderTranslation' => GenderEnum::MALE,
|
||||||
|
'type' => 'chill_main_gender',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->assertEquals($expected, $this->normalizer->normalize($gender));
|
$this->assertEquals($expected, $this->normalizer->normalize($gender));
|
||||||
|
@ -0,0 +1,156 @@
|
|||||||
|
<?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\MainBundle\Tests\Workflow\EventSubscriber;
|
||||||
|
|
||||||
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
|
use Chill\DocStoreBundle\Entity\StoredObjectPointInTime;
|
||||||
|
use Chill\DocStoreBundle\Entity\StoredObjectPointInTimeReasonEnum;
|
||||||
|
use Chill\DocStoreBundle\Service\StoredObjectRestoreInterface;
|
||||||
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||||
|
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||||
|
use Chill\MainBundle\Workflow\EntityWorkflowMarkingStore;
|
||||||
|
use Chill\MainBundle\Workflow\EventSubscriber\OnCancelRestoreDocumentToEditableEventSubscriber;
|
||||||
|
use Chill\MainBundle\Workflow\WorkflowTransitionContextDTO;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||||
|
use Symfony\Component\Workflow\DefinitionBuilder;
|
||||||
|
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
|
||||||
|
use Symfony\Component\Workflow\Registry;
|
||||||
|
use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface;
|
||||||
|
use Symfony\Component\Workflow\Transition;
|
||||||
|
use Symfony\Component\Workflow\Workflow;
|
||||||
|
use Symfony\Component\Workflow\WorkflowInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
|
class OnCancelRestoreDocumentToEditableEventSubscriberTest extends TestCase
|
||||||
|
{
|
||||||
|
private function buildRegistry(StoredObjectRestoreInterface $storedObjectRestore, ?StoredObject $storedObject): Registry
|
||||||
|
{
|
||||||
|
$builder = new DefinitionBuilder(
|
||||||
|
['initial', 'intermediate', 'final', 'cancel'],
|
||||||
|
[
|
||||||
|
new Transition('to_intermediate', ['initial'], ['intermediate']),
|
||||||
|
new Transition('intermediate_to_final', ['intermediate'], ['final']),
|
||||||
|
new Transition('to_final', ['initial'], ['final']),
|
||||||
|
new Transition('to_cancel', ['initial'], ['cancel']),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$builder->setMetadataStore(
|
||||||
|
new InMemoryMetadataStore(
|
||||||
|
placesMetadata: [
|
||||||
|
'final' => ['isFinal' => true],
|
||||||
|
'cancel' => ['isFinal' => true, 'isFinalPositive' => false],
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$registry = new Registry();
|
||||||
|
$workflow = new Workflow($builder->build(), new EntityWorkflowMarkingStore(), $eventDispatcher = new EventDispatcher(), 'dummy');
|
||||||
|
|
||||||
|
$manager = $this->createMock(EntityWorkflowManager::class);
|
||||||
|
$manager->method('getAssociatedStoredObject')->willReturn($storedObject);
|
||||||
|
|
||||||
|
$eventSubscriber = new OnCancelRestoreDocumentToEditableEventSubscriber(
|
||||||
|
$registry,
|
||||||
|
$manager,
|
||||||
|
$storedObjectRestore
|
||||||
|
);
|
||||||
|
$eventDispatcher->addSubscriber($eventSubscriber);
|
||||||
|
|
||||||
|
$registry->addWorkflow($workflow, new class () implements WorkflowSupportStrategyInterface {
|
||||||
|
public function supports(WorkflowInterface $workflow, object $subject): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return $registry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testOnCancelRestoreDocumentToEditableExpectsRestoring(): void
|
||||||
|
{
|
||||||
|
$storedObject = new StoredObject();
|
||||||
|
$version = $storedObject->registerVersion();
|
||||||
|
new StoredObjectPointInTime($version, StoredObjectPointInTimeReasonEnum::KEEP_BEFORE_CONVERSION);
|
||||||
|
$storedObject->registerVersion();
|
||||||
|
|
||||||
|
$restore = $this->createMock(StoredObjectRestoreInterface::class);
|
||||||
|
$restore->expects($this->once())->method('restore')->with($version);
|
||||||
|
|
||||||
|
$registry = $this->buildRegistry($restore, $storedObject);
|
||||||
|
$entityWorkflow = (new EntityWorkflow())->setWorkflowName('dummy');
|
||||||
|
|
||||||
|
$workflow = $registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
$context = new WorkflowTransitionContextDTO($entityWorkflow);
|
||||||
|
|
||||||
|
$workflow->apply($entityWorkflow, 'to_cancel', [
|
||||||
|
'context' => $context,
|
||||||
|
'transition' => 'to_cancel',
|
||||||
|
'transitionAt' => new \DateTimeImmutable('now'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testOnCancelRestoreDocumentDoNotExpectRestoring(): void
|
||||||
|
{
|
||||||
|
$storedObject = new StoredObject();
|
||||||
|
$version = $storedObject->registerVersion();
|
||||||
|
new StoredObjectPointInTime($version, StoredObjectPointInTimeReasonEnum::KEEP_BEFORE_CONVERSION);
|
||||||
|
$storedObject->registerVersion();
|
||||||
|
|
||||||
|
$restore = $this->createMock(StoredObjectRestoreInterface::class);
|
||||||
|
$restore->expects($this->never())->method('restore')->withAnyParameters();
|
||||||
|
|
||||||
|
$registry = $this->buildRegistry($restore, $storedObject);
|
||||||
|
$entityWorkflow = (new EntityWorkflow())->setWorkflowName('dummy');
|
||||||
|
|
||||||
|
$workflow = $registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
$context = new WorkflowTransitionContextDTO($entityWorkflow);
|
||||||
|
|
||||||
|
$workflow->apply($entityWorkflow, 'to_intermediate', [
|
||||||
|
'context' => $context,
|
||||||
|
'transition' => 'to_intermediate',
|
||||||
|
'transitionAt' => new \DateTimeImmutable('now'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$workflow->apply($entityWorkflow, 'intermediate_to_final', [
|
||||||
|
'context' => $context,
|
||||||
|
'transition' => 'intermediate_to_final',
|
||||||
|
'transitionAt' => new \DateTimeImmutable('now'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testOnCancelRestoreDocumentToEditableToCancelStoredObjectWithoutKepts(): void
|
||||||
|
{
|
||||||
|
$storedObject = new StoredObject();
|
||||||
|
$storedObject->registerVersion();
|
||||||
|
|
||||||
|
$restore = $this->createMock(StoredObjectRestoreInterface::class);
|
||||||
|
$restore->expects($this->never())->method('restore')->withAnyParameters();
|
||||||
|
|
||||||
|
$registry = $this->buildRegistry($restore, $storedObject);
|
||||||
|
$entityWorkflow = (new EntityWorkflow())->setWorkflowName('dummy');
|
||||||
|
|
||||||
|
$workflow = $registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
$context = new WorkflowTransitionContextDTO($entityWorkflow);
|
||||||
|
|
||||||
|
$workflow->apply($entityWorkflow, 'to_cancel', [
|
||||||
|
'context' => $context,
|
||||||
|
'transition' => 'to_cancel',
|
||||||
|
'transitionAt' => new \DateTimeImmutable('now'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
<?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\MainBundle\Workflow\EventSubscriber;
|
||||||
|
|
||||||
|
use Chill\DocStoreBundle\Service\StoredObjectRestoreInterface;
|
||||||
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||||
|
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||||
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
use Symfony\Component\Workflow\Event\TransitionEvent;
|
||||||
|
use Symfony\Component\Workflow\Registry;
|
||||||
|
|
||||||
|
final readonly class OnCancelRestoreDocumentToEditableEventSubscriber implements EventSubscriberInterface
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private Registry $registry,
|
||||||
|
private EntityWorkflowManager $manager,
|
||||||
|
private StoredObjectRestoreInterface $storedObjectRestore,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public static function getSubscribedEvents(): array
|
||||||
|
{
|
||||||
|
return ['workflow.transition' => ['onCancelRestoreDocumentToEditable', 0]];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onCancelRestoreDocumentToEditable(TransitionEvent $event): void
|
||||||
|
{
|
||||||
|
$entityWorkflow = $event->getSubject();
|
||||||
|
|
||||||
|
if (!$entityWorkflow instanceof EntityWorkflow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
|
||||||
|
foreach ($event->getTransition()->getTos() as $place) {
|
||||||
|
$metadata = $workflow->getMetadataStore()->getPlaceMetadata($place);
|
||||||
|
|
||||||
|
if (($metadata['isFinal'] ?? false) && !($metadata['isFinalPositive'] ?? true)) {
|
||||||
|
$this->restoreDocument($entityWorkflow);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function restoreDocument(EntityWorkflow $entityWorkflow): void
|
||||||
|
{
|
||||||
|
$storedObject = $this->manager->getAssociatedStoredObject($entityWorkflow);
|
||||||
|
|
||||||
|
if (null === $storedObject) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$version = $storedObject->getLastKeptBeforeConversionVersion();
|
||||||
|
|
||||||
|
if (null === $version) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->storedObjectRestore->restore($storedObject->getLastKeptBeforeConversionVersion());
|
||||||
|
}
|
||||||
|
}
|
@ -943,6 +943,16 @@ paths:
|
|||||||
description: "ok"
|
description: "ok"
|
||||||
401:
|
401:
|
||||||
description: "Unauthorized"
|
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:
|
/1.0/main/user-job.json:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
|
@ -86,10 +86,6 @@ module.exports = function (encore, entries) {
|
|||||||
"mod_entity_workflow_pick",
|
"mod_entity_workflow_pick",
|
||||||
__dirname + "/Resources/public/module/entity-workflow-pick/index.js",
|
__dirname + "/Resources/public/module/entity-workflow-pick/index.js",
|
||||||
);
|
);
|
||||||
encore.addEntry(
|
|
||||||
"mod_wopi_link",
|
|
||||||
__dirname + "/Resources/public/module/wopi-link/index.js",
|
|
||||||
);
|
|
||||||
encore.addEntry(
|
encore.addEntry(
|
||||||
"mod_pick_postal_code",
|
"mod_pick_postal_code",
|
||||||
__dirname + "/Resources/public/module/pick-postal-code/index.js",
|
__dirname + "/Resources/public/module/pick-postal-code/index.js",
|
||||||
|
@ -44,6 +44,9 @@ address_fields: Données liées à l'adresse
|
|||||||
Datas: Données
|
Datas: Données
|
||||||
No title: Aucun titre
|
No title: Aucun titre
|
||||||
icon: icône
|
icon: icône
|
||||||
|
See: Voir
|
||||||
|
Name: Nom
|
||||||
|
Label: Nom
|
||||||
|
|
||||||
user:
|
user:
|
||||||
profile:
|
profile:
|
||||||
@ -56,6 +59,7 @@ user_group:
|
|||||||
inactive: Inactif
|
inactive: Inactif
|
||||||
with_users: Membres
|
with_users: Membres
|
||||||
no_users: Aucun utilisateur associé
|
no_users: Aucun utilisateur associé
|
||||||
|
no_user_groups: Aucune groupe d'utilisateurs
|
||||||
no_admin_users: Aucun administrateur
|
no_admin_users: Aucun administrateur
|
||||||
Label: Nom du groupe
|
Label: Nom du groupe
|
||||||
BackgroundColor: Couleur de fond du badge
|
BackgroundColor: Couleur de fond du badge
|
||||||
@ -126,6 +130,49 @@ address:
|
|||||||
address_homeless: L'adresse est-elle celle d'un domicile fixe ?
|
address_homeless: L'adresse est-elle celle d'un domicile fixe ?
|
||||||
real address: Adresse d'un domicile
|
real address: Adresse d'un domicile
|
||||||
consider homeless: Cette adresse est incomplète
|
consider homeless: Cette adresse est incomplète
|
||||||
|
add_an_address_title: Créer une adresse
|
||||||
|
edit_an_address_title: Modifier une adresse
|
||||||
|
create_a_new_address: Créer une nouvelle adresse
|
||||||
|
edit_address: Modifier l'adresse
|
||||||
|
select_an_address_title: Sélectionner une adresse
|
||||||
|
fill_an_address: Compléter l'adresse
|
||||||
|
select_country: Choisir le pays
|
||||||
|
country: Pays
|
||||||
|
select_city: Choisir une localité
|
||||||
|
city: Localité
|
||||||
|
other_city: Autre localité
|
||||||
|
select_address: Choisir une adresse
|
||||||
|
address: Adresse
|
||||||
|
other_address: Autre adresse
|
||||||
|
create_address: Adresse inconnue. Cliquez ici pour créer une nouvelle adresse
|
||||||
|
isNoAddress: Pas d'adresse complète
|
||||||
|
isConfidential: Adresse confidentielle
|
||||||
|
street: Nom de rue
|
||||||
|
streetNumber: Numéro
|
||||||
|
floor: Étage
|
||||||
|
corridor: Couloir
|
||||||
|
steps: Escalier
|
||||||
|
flat: Appartement
|
||||||
|
buildingName: Résidence
|
||||||
|
extra: Complément d'adresse
|
||||||
|
distribution: Cedex
|
||||||
|
create_postal_code: Localité inconnue. Cliquez ici pour créer une nouvelle localité
|
||||||
|
postalCode_name: Nom
|
||||||
|
postalCode_code: Code postal
|
||||||
|
date: Date de la nouvelle adresse
|
||||||
|
valid_from: L'adresse est valable à partir du
|
||||||
|
valid_to: L'adresse est valable jusqu'au
|
||||||
|
back_to_the_list: Retour à la liste
|
||||||
|
loading: chargement en cours...
|
||||||
|
address_suggestions: Suggestion d'adresses
|
||||||
|
address_new_success: La nouvelle adresse est enregistrée.
|
||||||
|
address_edit_success: L'adresse a été mise à jour.
|
||||||
|
wait_redirection: La page est redirigée.
|
||||||
|
not_yet_address: Il n'y a pas encore d'adresse. Cliquez sur '+ Créer une adresse'
|
||||||
|
use_this_address: Utiliser cette adresse
|
||||||
|
household:
|
||||||
|
move_date: Date du déménagement
|
||||||
|
|
||||||
address more:
|
address more:
|
||||||
floor: ét
|
floor: ét
|
||||||
corridor: coul
|
corridor: coul
|
||||||
@ -510,6 +557,8 @@ Follow workflow: Suivre la décision
|
|||||||
Workflow history: Historique de la décision
|
Workflow history: Historique de la décision
|
||||||
|
|
||||||
workflow:
|
workflow:
|
||||||
|
list: Liste des workflows associés
|
||||||
|
associated: workflow associé
|
||||||
deleted: Workflow supprimé
|
deleted: Workflow supprimé
|
||||||
Created by: Créé par
|
Created by: Créé par
|
||||||
My decision: Ma décision
|
My decision: Ma décision
|
||||||
@ -555,6 +604,7 @@ workflow:
|
|||||||
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
||||||
For: Pour
|
For: Pour
|
||||||
Cc: Cc
|
Cc: Cc
|
||||||
|
At: Le
|
||||||
You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire.
|
You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire.
|
||||||
An access key was also sent to those addresses: Un lien d'accès a été envoyé à ces adresses
|
An access key was also sent to those addresses: Un lien d'accès a été envoyé à ces adresses
|
||||||
Those users are also granted to apply a transition by using an access key: Ces utilisateurs ont obtenu l'accès grâce au lien reçu par email
|
Those users are also granted to apply a transition by using an access key: Ces utilisateurs ont obtenu l'accès grâce au lien reçu par email
|
||||||
@ -577,6 +627,12 @@ workflow:
|
|||||||
public_views_by_ip: Visualisation par adresse IP
|
public_views_by_ip: Visualisation par adresse IP
|
||||||
May not associate a document: Le workflow ne concerne pas un document
|
May not associate a document: Le workflow ne concerne pas un document
|
||||||
|
|
||||||
|
subscribe_final: Recevoir une notification à l'étape finale
|
||||||
|
unsubscribe_final: Ne plus recevoir de notification à l'étape finale
|
||||||
|
subscribe_all_steps: Recevoir une notification à chaque étape du suivi
|
||||||
|
unsubscribe_all_steps: Ne plus recevoir de notification à chaque étape du suivi
|
||||||
|
|
||||||
|
|
||||||
public_link:
|
public_link:
|
||||||
expired_link_title: Lien expiré
|
expired_link_title: Lien expiré
|
||||||
expired_link_explanation: Le lien a expiré, vous ne pouvez plus visualiser ce document.
|
expired_link_explanation: Le lien a expiré, vous ne pouvez plus visualiser ce document.
|
||||||
@ -658,6 +714,10 @@ notification:
|
|||||||
Remove an email: Supprimer l'adresse email
|
Remove an email: Supprimer l'adresse email
|
||||||
Email with access link: Adresse email ayant reçu un lien d'accès
|
Email with access link: Adresse email ayant reçu un lien d'accès
|
||||||
|
|
||||||
|
mark_as_read: Marquer comme lu
|
||||||
|
mark_as_unread: Marquer comme non-lu
|
||||||
|
|
||||||
|
|
||||||
export:
|
export:
|
||||||
address_helper:
|
address_helper:
|
||||||
id: Identifiant de l'adresse
|
id: Identifiant de l'adresse
|
||||||
@ -678,6 +738,26 @@ export:
|
|||||||
steps: Escaliers
|
steps: Escaliers
|
||||||
_lat: Latitude
|
_lat: Latitude
|
||||||
_lon: Longitude
|
_lon: Longitude
|
||||||
|
social_action_list:
|
||||||
|
id: Identifiant de l'action
|
||||||
|
social_issue_id: Identifiant de la problématique sociale
|
||||||
|
social_issue: Problématique sociale
|
||||||
|
desactivation_date: Date de désactivation
|
||||||
|
social_issue_ordering: Ordre de la problématique sociale
|
||||||
|
action_label: Action d'accompagnement
|
||||||
|
action_ordering: Ordre
|
||||||
|
goal_label: Objectif
|
||||||
|
goal_id: Identifiant de l'objectif
|
||||||
|
goal_result_label: Résultat
|
||||||
|
goal_result_id: Identifiant du résultat
|
||||||
|
result_without_goal_label: Résultat (sans objectif)
|
||||||
|
result_without_goal_id: Identifiant du résultat (sans objectif)
|
||||||
|
evaluation_title: Évaluation
|
||||||
|
evaluation_id: Identifiant de l'évaluation
|
||||||
|
evaluation_url: Adresse URL externe (évaluation)
|
||||||
|
evaluation_delay_month: Délai de notification (mois)
|
||||||
|
evaluation_delay_week: Délai de notification (semaine)
|
||||||
|
evaluation_delay_day: Délai de notification (jours)
|
||||||
|
|
||||||
rolling_date:
|
rolling_date:
|
||||||
year_previous_start: Début de l'année précédente
|
year_previous_start: Début de l'année précédente
|
||||||
@ -797,4 +877,43 @@ gender:
|
|||||||
Select gender translation: Traduction grammaticale
|
Select gender translation: Traduction grammaticale
|
||||||
Select gender icon: Icône à utiliser
|
Select gender icon: Icône à utiliser
|
||||||
|
|
||||||
|
wopi:
|
||||||
|
online_edit_document: Éditer en ligne
|
||||||
|
save_and_quit: Enregistrer et quitter
|
||||||
|
loading: Chargement de l'éditeur en ligne
|
||||||
|
invalid_title: Format incompatible
|
||||||
|
invalid_message: Désolé, ce format de document n'est pas éditable en ligne.
|
||||||
|
|
||||||
|
onthefly:
|
||||||
|
show:
|
||||||
|
person: Détails de l'usager
|
||||||
|
thirdparty: Détails du tiers
|
||||||
|
file_person: Ouvrir la fiche de l'usager
|
||||||
|
file_thirdparty: Voir le Tiers
|
||||||
|
edit:
|
||||||
|
person: Modifier un usager
|
||||||
|
thirdparty: Modifier un tiers
|
||||||
|
create:
|
||||||
|
button: Créer {q}
|
||||||
|
title:
|
||||||
|
default: Création d'un nouvel usager ou d'un tiers professionnel
|
||||||
|
person: Création d'un nouvel usager
|
||||||
|
thirdparty: Création d'un nouveau tiers professionnel
|
||||||
|
person: un nouvel usager
|
||||||
|
thirdparty: un nouveau tiers professionnel
|
||||||
|
addContact:
|
||||||
|
title: Créer un contact pour {q}
|
||||||
|
resource_comment_title: Un commentaire est associé à cet interlocuteur
|
||||||
|
|
||||||
|
modal:
|
||||||
|
action:
|
||||||
|
close: Fermer
|
||||||
|
|
||||||
|
multiselect:
|
||||||
|
placeholder: Choisir
|
||||||
|
tag_placeholder: Créer un nouvel élément
|
||||||
|
select_label: Entrée ou cliquez pour sélectionner
|
||||||
|
deselect_label: Entrée ou cliquez pour désélectionner
|
||||||
|
select_group_label: Appuyer sur "Entrée" pour sélectionner ce groupe
|
||||||
|
deselect_group_label: Appuyer sur "Entrée" pour désélectionner ce groupe
|
||||||
|
selected_label: Sélectionné'
|
||||||
|
@ -26,7 +26,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
|
|||||||
{
|
{
|
||||||
$now = $this->clock->now();
|
$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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user