mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-09 21:58:28 +00:00
Compare commits
4 Commits
v3.11.0
...
362-bug-ma
| Author | SHA1 | Date | |
|---|---|---|---|
| 499aa3adea | |||
| b597ff89e0 | |||
| 3c801a6d0e | |||
| 4093949c2f |
6
.changes/unreleased/DX-20250131-131801.yaml
Normal file
6
.changes/unreleased/DX-20250131-131801.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: DX
|
||||||
|
body: Create an unique source of trust for translations
|
||||||
|
time: 2025-01-31T13:18:01.239211506+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "333"
|
||||||
|
SchemaChange: No schema change
|
||||||
6
.changes/unreleased/Feature-20250130-120207.yaml
Normal file
6
.changes/unreleased/Feature-20250130-120207.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Suggest all referrers within actions of the accompanying period when creating an activity
|
||||||
|
time: 2025-01-30T12:02:07.053587034+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "349"
|
||||||
|
SchemaChange: No schema change
|
||||||
6
.changes/unreleased/Feature-20250130-120459.yaml
Normal file
6
.changes/unreleased/Feature-20250130-120459.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Add possibility to export a csv with all social issues and social actions
|
||||||
|
time: 2025-01-30T12:04:59.754998541+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "343"
|
||||||
|
SchemaChange: No schema change
|
||||||
6
.changes/unreleased/Feature-20250214-150328.yaml
Normal file
6
.changes/unreleased/Feature-20250214-150328.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Restore document to previous kept version when a workflow is canceled
|
||||||
|
time: 2025-02-14T15:03:28.707250207+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "360"
|
||||||
|
SchemaChange: No schema change
|
||||||
6
.changes/unreleased/Feature-20250219-120928.yaml
Normal file
6
.changes/unreleased/Feature-20250219-120928.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Add a list of third parties from within the admin (csv download)
|
||||||
|
time: 2025-02-19T12:09:28.487991703+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "341"
|
||||||
|
SchemaChange: No schema change
|
||||||
6
.changes/unreleased/Fixed-20250214-121010.yaml
Normal file
6
.changes/unreleased/Fixed-20250214-121010.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: fix generation of document with accompanying period context, and list of activities and works
|
||||||
|
time: 2025-02-14T12:10:10.920355454+01:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
||||||
|
SchemaChange: No schema change
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
## 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
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## v3.10.1 - 2025-03-17
|
|
||||||
### DX
|
|
||||||
* Remove yarn dependency to symfony/ux-translator, to ease the build process
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## v3.10.2 - 2025-03-17
|
|
||||||
### Fixed
|
|
||||||
* Replace a ts-expect-error with a ts-ignore
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## v3.10.3 - 2025-03-18
|
|
||||||
### DX
|
|
||||||
* Eslint fixes
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
## 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
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
## 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
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## v3.9.1 - 2025-02-27
|
|
||||||
### Fixed
|
|
||||||
* Fix post/patch request with missing 'type' property for gender
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## v3.9.2 - 2025-02-27
|
|
||||||
### Fixed
|
|
||||||
* Use fetchResults method to fetch all social issues instead of only the first page
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,7 +13,6 @@ 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/translator.ts
|
||||||
!assets/ux-translator
|
|
||||||
migrations/*
|
migrations/*
|
||||||
templates/*
|
templates/*
|
||||||
translations/*
|
translations/*
|
||||||
|
|||||||
38
CHANGELOG.md
38
CHANGELOG.md
@@ -6,44 +6,6 @@ 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
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { trans, setLocale, setLocaleFallbacks } from "./ux-translator";
|
// @ts-ignore Cannot find module (when used within an app)
|
||||||
|
import { trans, getLocale, setLocale, setLocaleFallbacks } from "@symfony/ux-translator";
|
||||||
|
|
||||||
setLocaleFallbacks({"en": "fr", "nl": "fr", "fr": "en"});
|
setLocaleFallbacks({"en": "fr", "nl": "fr", "fr": "en"});
|
||||||
setLocale('fr');
|
setLocale('fr');
|
||||||
|
|
||||||
export { trans };
|
export { trans };
|
||||||
|
// @ts-ignore Cannot find module (when used within an app)
|
||||||
export * from '../var/translations';
|
export * from '../var/translations';
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
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 +0,0 @@
|
|||||||
export declare function format(id: string, parameters: Record<string, string | number>, locale: string): string;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export declare function formatIntl(id: string, parameters: Record<string, string | number>, locale: string): string;
|
|
||||||
27
assets/ux-translator/dist/translator.d.ts
vendored
27
assets/ux-translator/dist/translator.d.ts
vendored
@@ -1,27 +0,0 @@
|
|||||||
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 +0,0 @@
|
|||||||
export * from './translator';
|
|
||||||
283
assets/ux-translator/dist/translator_controller.js
vendored
283
assets/ux-translator/dist/translator_controller.js
vendored
@@ -1,283 +0,0 @@
|
|||||||
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
1
assets/ux-translator/dist/utils.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
export declare function strtr(string: string, replacePairs: Record<string, string | number>): string;
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@symfony/ux-translator",
|
|
||||||
"description": "Symfony Translator for JavaScript",
|
|
||||||
"license": "MIT",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"main": "dist/translator_controller.js",
|
|
||||||
"types": "dist/translator_controller.d.ts",
|
|
||||||
"scripts": {
|
|
||||||
"build": "node ../../../bin/build_package.js .",
|
|
||||||
"watch": "node ../../../bin/build_package.js . --watch",
|
|
||||||
"test": "../../../bin/test_package.sh .",
|
|
||||||
"check": "biome check",
|
|
||||||
"ci": "biome ci"
|
|
||||||
},
|
|
||||||
"symfony": {
|
|
||||||
"importmap": {
|
|
||||||
"intl-messageformat": "^10.5.11",
|
|
||||||
"@symfony/ux-translator": "path:%PACKAGE%/dist/translator_controller.js",
|
|
||||||
"@app/translations": "path:var/translations/index.js",
|
|
||||||
"@app/translations/configuration": "path:var/translations/configuration.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"intl-messageformat": "^10.5.11"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"intl-messageformat": {
|
|
||||||
"optional": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"intl-messageformat": "^10.5.11"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -34,7 +34,6 @@ 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"
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"@hotwired/stimulus": "^3.0.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/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",
|
||||||
@@ -58,7 +59,6 @@
|
|||||||
"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",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ 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;
|
||||||
@@ -24,30 +23,22 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(protected Security $security, protected TranslatorInterface $translator) {}
|
||||||
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('Activities'), [
|
$menu->addChild($this->translator->trans('Activity'), [
|
||||||
'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, 'counter' => count($activities) > 0 ? count($activities) : null]);
|
->setExtras(['order' => 40]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ 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;
|
||||||
@@ -24,20 +23,13 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {}
|
||||||
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'),
|
||||||
@@ -46,7 +38,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'routeParameters' => ['person_id' => $person->getId()],
|
'routeParameters' => ['person_id' => $person->getId()],
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->setExtras(['order' => 201, 'counter' => $count > 0 ? $count : null]);
|
->setExtra('order', 201);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,34 +120,3 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -68,23 +68,14 @@
|
|||||||
socialActionsSelected.length)
|
socialActionsSelected.length)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div
|
<check-social-action
|
||||||
id="actionsList"
|
v-for="action in socialActionsList"
|
||||||
v-for="group in socialActionsList"
|
:key="action.id"
|
||||||
:key="group.issue"
|
:action="action"
|
||||||
|
:selection="socialActionsSelected"
|
||||||
|
@updateSelected="updateActionsSelected"
|
||||||
>
|
>
|
||||||
<span class="badge bg-chill-l-gray text-dark">{{
|
</check-social-action>
|
||||||
group.issue
|
|
||||||
}}</span>
|
|
||||||
<check-social-action
|
|
||||||
v-for="action in group.actions"
|
|
||||||
:key="action.id"
|
|
||||||
:action="action"
|
|
||||||
:selection="socialActionsSelected"
|
|
||||||
@updateSelected="updateActionsSelected"
|
|
||||||
>
|
|
||||||
</check-social-action>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
@@ -158,44 +149,53 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
/* Load other issues in multiselect */
|
/* Load others issues in multiselect
|
||||||
|
*/
|
||||||
this.issueIsLoading = true;
|
this.issueIsLoading = true;
|
||||||
this.actionAreLoaded = false;
|
this.actionAreLoaded = false;
|
||||||
|
getSocialIssues().then(
|
||||||
|
(response) =>
|
||||||
|
new Promise((resolve) => {
|
||||||
|
this.$store.commit("updateIssuesOther", response.results);
|
||||||
|
|
||||||
getSocialIssues().then((response) => {
|
/* Add in list the issues already associated (if not yet listed)
|
||||||
/* Add issues to the store */
|
*/
|
||||||
this.$store.commit("updateIssuesOther", response);
|
this.socialIssuesSelected.forEach((issue) => {
|
||||||
|
if (
|
||||||
|
this.socialIssuesList.filter(
|
||||||
|
(i) => i.id === issue.id,
|
||||||
|
).length !== 1
|
||||||
|
) {
|
||||||
|
this.$store.commit("addIssueInList", issue);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
|
||||||
/* Add in list the issues already associated (if not yet listed) */
|
/* Remove from multiselect the issues that are not yet in checkbox list
|
||||||
this.socialIssuesSelected.forEach((issue) => {
|
*/
|
||||||
if (
|
this.socialIssuesList.forEach((issue) => {
|
||||||
this.socialIssuesList.filter((i) => i.id === issue.id)
|
this.$store.commit("removeIssueInOther", issue);
|
||||||
.length !== 1
|
}, this);
|
||||||
) {
|
|
||||||
this.$store.commit("addIssueInList", issue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Remove from multiselect the issues that are not yet in the checkbox list */
|
/* Filter issues
|
||||||
this.socialIssuesList.forEach((issue) => {
|
*/
|
||||||
this.$store.commit("removeIssueInOther", issue);
|
this.$store.commit("filterList", "issues");
|
||||||
});
|
|
||||||
|
|
||||||
/* Filter issues */
|
/* Add in list the actions already associated (if not yet listed)
|
||||||
this.$store.commit("filterList", "issues");
|
*/
|
||||||
|
this.socialActionsSelected.forEach((action) => {
|
||||||
|
this.$store.commit("addActionInList", action);
|
||||||
|
}, this);
|
||||||
|
|
||||||
/* Add in list the actions already associated (if not yet listed) */
|
/* Filter issues
|
||||||
this.socialActionsSelected.forEach((action) => {
|
*/
|
||||||
this.$store.commit("addActionInList", action);
|
this.$store.commit("filterList", "actions");
|
||||||
});
|
|
||||||
|
|
||||||
/* Filter actions */
|
this.issueIsLoading = false;
|
||||||
this.$store.commit("filterList", "actions");
|
this.actionAreLoaded = true;
|
||||||
|
this.updateActionsList();
|
||||||
this.issueIsLoading = false;
|
resolve();
|
||||||
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),
|
||||||
@@ -258,23 +258,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<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,9 +10,7 @@
|
|||||||
: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" :title="action.text">{{
|
<span class="badge bg-light text-dark">{{ action.text }}</span>
|
||||||
action.text
|
|
||||||
}}</span>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
@@ -45,9 +43,5 @@ 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>
|
||||||
|
|||||||
@@ -124,19 +124,9 @@ const store = createStore({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
socialActionsListSorted(state) {
|
socialActionsListSorted(state) {
|
||||||
return [...state.socialActionsList]
|
return [...state.socialActionsList].sort(
|
||||||
.sort((a, b) => a.ordering - b.ordering)
|
(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: {
|
||||||
|
|||||||
@@ -13,44 +13,44 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-two-col-grid">
|
<div class="item-col" style="width: unset">
|
||||||
<div class="title">
|
{% if document.isPending %}
|
||||||
{% if document.isPending %}
|
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
{% elseif document.isFailure %}
|
||||||
{% elseif document.isFailure %}
|
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div>
|
{% if activity.accompanyingPeriod is not null and context == 'person' %}
|
||||||
<div class="badge-activity-type-simple">
|
<span class="badge bg-primary">
|
||||||
{{ activity.type.name | localize_translatable_string }}
|
<i class="fa fa-random"></i> {{ activity.accompanyingPeriod.id }}
|
||||||
</div>
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
<div class="badge-activity-type">
|
||||||
|
<span class="title_label"></span>
|
||||||
|
<span class="title_action">
|
||||||
|
{{ activity.type.name | localize_translatable_string }}
|
||||||
{% 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 %}
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="denomination h2">
|
|
||||||
{{ document.title|chill_print_or_message("No title") }}
|
|
||||||
</div>
|
|
||||||
{% if document.hasTemplate %}
|
|
||||||
<div>
|
|
||||||
<p>{{ document.template.name|localize_translatable_string }}</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="aside">
|
<div class="denomination h2">
|
||||||
|
{{ document.title|chill_print_or_message("No title") }}
|
||||||
|
</div>
|
||||||
|
{% if document.hasTemplate %}
|
||||||
|
<div>
|
||||||
|
<p>{{ document.template.name|localize_translatable_string }}</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-col">
|
||||||
|
<div class="container">
|
||||||
<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>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use Chill\CalendarBundle\Repository\CalendarRepository;
|
|||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -23,7 +24,10 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
|
|
||||||
class CalendarAPIController extends ApiController
|
class CalendarAPIController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly CalendarRepository $calendarRepository) {}
|
public function __construct(private readonly CalendarRepository $calendarRepository, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])]
|
#[Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])]
|
||||||
public function listByUser(User $user, Request $request, string $_format): JsonResponse
|
public function listByUser(User $user, Request $request, string $_format): JsonResponse
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use Chill\CalendarBundle\Repository\CalendarRangeRepository;
|
|||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -23,7 +24,10 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
|
|
||||||
class CalendarRangeAPIController extends ApiController
|
class CalendarRangeAPIController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) {}
|
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/calendar/calendar-range-available/{id}.{_format}', name: 'chill_api_single_calendar_range_available', requirements: ['_format' => 'json'])]
|
#[Route(path: '/api/1.0/calendar/calendar-range-available/{id}.{_format}', name: 'chill_api_single_calendar_range_available', requirements: ['_format' => 'json'])]
|
||||||
public function availableRanges(User $user, Request $request, string $_format): JsonResponse
|
public function availableRanges(User $user, Request $request, string $_format): JsonResponse
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
@import '~ChillMainAssets/module/bootstrap/shared';
|
|
||||||
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
||||||
@import 'bootstrap/scss/_badge.scss';
|
@import '~ChillMainAssets/module/bootstrap/shared';
|
||||||
|
|
||||||
.badge-calendar {
|
.badge-calendar {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -24,35 +23,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.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,13 +96,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||||
<template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
|
<template v-slot:eventContent="arg: EventApi">
|
||||||
<span :class="eventClasses(arg.event)">
|
<span :class="eventClasses(arg.event)">
|
||||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
||||||
arg.event.title
|
arg.event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||||
>{{ arg.event.startStr }} -
|
>{{ arg.timeText }} -
|
||||||
{{ arg.event.extendedProps.locationName }}</b
|
{{ arg.event.extendedProps.locationName }}</b
|
||||||
>
|
>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||||
|
|||||||
@@ -6,48 +6,50 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-two-col-grid">
|
<div class="item-col" style="width: unset">
|
||||||
<div class="title">
|
{% if document.storedObject.isPending %}
|
||||||
{% if document.storedObject.isPending %}
|
<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-info" data-docgen-is-pending="{{ document.storedObject.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
{% elseif document.storedObject.isFailure %}
|
||||||
{% elseif document.storedObject.isFailure %}
|
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
{% endif %}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{% if c.accompanyingPeriod is not null and context == 'person' %}
|
||||||
|
<span class="badge bg-primary">
|
||||||
|
<i class="fa fa-random"></i> {{ c.accompanyingPeriod.id }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div>
|
<span class="badge-calendar">
|
||||||
|
<span class="title_label"></span>
|
||||||
<span class="badge-calendar-simple">
|
<span class="title_action">
|
||||||
{{ 'Calendar'|trans }}
|
{{ 'Calendar'|trans }}
|
||||||
{% if c.endDate.diff(c.startDate).days >= 1 %}
|
{% if c.endDate.diff(c.startDate).days >= 1 %}
|
||||||
{{ c.startDate|format_datetime('short', 'short') }}
|
{{ c.startDate|format_datetime('short', 'short') }}
|
||||||
- {{ c.endDate|format_datetime('short', 'short') }}
|
- {{ c.endDate|format_datetime('short', 'short') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ c.startDate|format_datetime('short', 'short') }}
|
{{ c.startDate|format_datetime('short', 'short') }}
|
||||||
- {{ c.endDate|format_datetime('none', 'short') }}
|
- {{ c.endDate|format_datetime('none', 'short') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="denomination h2">
|
|
||||||
{{ document.storedObject.title|chill_print_or_message("No title") }}
|
|
||||||
</div>
|
|
||||||
{% if document.storedObject.hasTemplate %}
|
|
||||||
<div>
|
|
||||||
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="aside">
|
|
||||||
|
<div class="denomination h2">
|
||||||
|
{{ document.storedObject.title|chill_print_or_message("No title") }}
|
||||||
|
</div>
|
||||||
|
{% if document.storedObject.hasTemplate %}
|
||||||
|
<div>
|
||||||
|
<p>{{ document.storedObject.template.name|localize_translatable_string }}</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-col">
|
||||||
|
<div class="container">
|
||||||
<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>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Controller;
|
|||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
@@ -27,7 +28,10 @@ class StoredObjectApiController extends ApiController
|
|||||||
private readonly Security $security,
|
private readonly Security $security,
|
||||||
private readonly SerializerInterface $serializer,
|
private readonly SerializerInterface $serializer,
|
||||||
private readonly EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
) {}
|
ManagerRegistry $managerRegistry,
|
||||||
|
) {
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new stored object.
|
* Creates a new stored object.
|
||||||
|
|||||||
@@ -2,28 +2,26 @@
|
|||||||
<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>{{ trans(SIGNATURES_SIGNATURE_CONFIRMATION) }}</h2>
|
<h2>{{ $t("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>
|
<p>{{ $t("electronic_signature_in_progress") }}</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="trans(SIGNATURES_LOADING)"
|
:title="$t('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>{{ trans(SIGNATURES_YOU_ARE_GOING_TO_SIGN) }}</p>
|
<p>{{ $t("you_are_going_to_sign") }}</p>
|
||||||
<p>{{ trans(SIGNATURES_ARE_YOU_SURE) }}</p>
|
<p>{{ $t("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">
|
||||||
{{ trans(SIGNATURES_YES) }}
|
{{ $t("yes") }}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
@@ -84,39 +82,33 @@
|
|||||||
@change="toggleMultiPage"
|
@change="toggleMultiPage"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="checkboxMulti">
|
<label class="form-check-label" for="checkboxMulti">
|
||||||
{{ trans(SIGNATURES_ALL_PAGES) }}
|
{{ $t("all_pages") }}
|
||||||
</label>
|
</label>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length > 0"
|
||||||
class="col-5 p-0 text-center turnSignature"
|
class="col-5 p-0 text-center turnSignature"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="btn btn-light btn-sm"
|
:disabled="
|
||||||
@click="goToSignatureZoneUnique"
|
userSignatureZone === null ||
|
||||||
>
|
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)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
{{ $t("last_zone") }}
|
||||||
</button>
|
</button>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<button
|
<button
|
||||||
:disabled="isLastSignatureZone()"
|
:disabled="
|
||||||
|
userSignatureZone?.index >= signature.zones.length - 1
|
||||||
|
"
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(1)"
|
@click="turnSignature(1)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
{{ $t("next_zone") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||||
@@ -125,9 +117,9 @@
|
|||||||
:hidden="!userSignatureZone"
|
:hidden="!userSignatureZone"
|
||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-if="signature.zones.length > 1"
|
v-if="signature.zones.length > 1"
|
||||||
:title="trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE)"
|
:title="$t('choose_another_signature')"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_ANOTHER_ZONE) }}
|
{{ $t("another_zone") }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc btn-sm"
|
class="btn btn-misc btn-sm"
|
||||||
@@ -135,7 +127,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-else
|
v-else
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_CANCEL) }}
|
{{ $t("cancel") }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="userSignatureZone === null"
|
v-if="userSignatureZone === null"
|
||||||
@@ -147,7 +139,7 @@
|
|||||||
active: canvasEvent === 'add',
|
active: canvasEvent === 'add',
|
||||||
}"
|
}"
|
||||||
@click="toggleAddZone()"
|
@click="toggleAddZone()"
|
||||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
:title="$t('add_sign_zone')"
|
||||||
>
|
>
|
||||||
<template v-if="canvasEvent === 'add'">
|
<template v-if="canvasEvent === 'add'">
|
||||||
<div
|
<div
|
||||||
@@ -199,70 +191,58 @@
|
|||||||
@change="toggleMultiPage"
|
@change="toggleMultiPage"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="checkboxMulti">
|
<label class="form-check-label" for="checkboxMulti">
|
||||||
{{ trans(SIGNATURES_SEE_ALL_PAGES) }}
|
{{ $t("see_all_pages") }}
|
||||||
</label>
|
</label>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length > 0 && 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
|
||||||
class="btn btn-light btn-sm"
|
:disabled="
|
||||||
@click="goToSignatureZoneUnique"
|
userSignatureZone === null ||
|
||||||
>
|
userSignatureZone?.index < 1
|
||||||
{{ trans(SIGNATURES_GO_TO_SIGNATURE_UNIQUE) }}
|
"
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="signature.zones.length > 1 && signedState !== 'signed'"
|
|
||||||
class="col-4 d-xl-none text-center turnSignature p-0"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
:disabled="isFirstSignatureZone()"
|
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(-1)"
|
@click="turnSignature(-1)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_LAST_ZONE) }}
|
{{ $t("last_zone") }}
|
||||||
</button>
|
</button>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<button
|
<button
|
||||||
:disabled="isLastSignatureZone()"
|
:disabled="
|
||||||
|
userSignatureZone?.index >= signature.zones.length - 1
|
||||||
|
"
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(1)"
|
@click="turnSignature(1)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_NEXT_ZONE) }}
|
{{ $t("next_zone") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="signature.zones.length === 1 && signedState !== 'signed'"
|
v-if="signature.zones.length > 0 && signedState !== 'signed'"
|
||||||
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
class="col-4 d-none d-xl-flex p-0 text-center turnSignature"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="btn btn-light btn-sm"
|
:disabled="
|
||||||
@click="goToSignatureZoneUnique"
|
userSignatureZone === null ||
|
||||||
>
|
userSignatureZone?.index < 1
|
||||||
{{ 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"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(-1)"
|
@click="turnSignature(-1)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_LAST_SIGN_ZONE) }}
|
{{ $t("last_sign_zone") }}
|
||||||
</button>
|
</button>
|
||||||
<span>|</span>
|
<span>|</span>
|
||||||
<button
|
<button
|
||||||
:disabled="isLastSignatureZone()"
|
:disabled="
|
||||||
|
userSignatureZone?.index >= signature.zones.length - 1
|
||||||
|
"
|
||||||
class="btn btn-light btn-sm"
|
class="btn btn-light btn-sm"
|
||||||
@click="turnSignature(1)"
|
@click="turnSignature(1)"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_NEXT_SIGN_ZONE) }}
|
{{ $t("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'">
|
||||||
@@ -272,7 +252,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-if="signature.zones.length > 1"
|
v-if="signature.zones.length > 1"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE) }}
|
{{ $t("choose_another_signature") }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-misc btn-sm"
|
class="btn btn-misc btn-sm"
|
||||||
@@ -280,7 +260,7 @@
|
|||||||
@click="undoSign"
|
@click="undoSign"
|
||||||
v-else
|
v-else
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_CANCEL) }}
|
{{ $t("cancel") }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="userSignatureZone === null"
|
v-if="userSignatureZone === null"
|
||||||
@@ -292,13 +272,13 @@
|
|||||||
active: canvasEvent === 'add',
|
active: canvasEvent === 'add',
|
||||||
}"
|
}"
|
||||||
@click="toggleAddZone()"
|
@click="toggleAddZone()"
|
||||||
:title="trans(SIGNATURES_ADD_SIGN_ZONE)"
|
:title="$t('add_sign_zone')"
|
||||||
>
|
>
|
||||||
<template v-if="canvasEvent !== 'add'">
|
<template v-if="canvasEvent !== 'add'">
|
||||||
{{ trans(SIGNATURES_ADD_ZONE) }}
|
{{ $t("add_zone") }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{ trans(SIGNATURES_CLICK_ON_DOCUMENT) }}
|
{{ $t("click_on_document") }}
|
||||||
<div
|
<div
|
||||||
class="spinner-border spinner-border-sm"
|
class="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
@@ -332,10 +312,10 @@
|
|||||||
v-if="signedState !== 'signed'"
|
v-if="signedState !== 'signed'"
|
||||||
:href="getReturnPath()"
|
:href="getReturnPath()"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_CANCEL) }}
|
{{ $t("cancel") }}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
<a class="btn btn-misc" v-else :href="getReturnPath()">
|
||||||
{{ trans(SIGNATURES_RETURN) }}
|
{{ $t("return") }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end" v-if="signedState !== 'signed'">
|
<div class="col text-end" v-if="signedState !== 'signed'">
|
||||||
@@ -344,7 +324,7 @@
|
|||||||
:disabled="!userSignatureZone"
|
:disabled="!userSignatureZone"
|
||||||
@click="sign"
|
@click="sign"
|
||||||
>
|
>
|
||||||
{{ trans(SIGNATURES_SIGN) }}
|
{{ $t("sign") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4" v-else></div>
|
<div class="col-4" v-else></div>
|
||||||
@@ -353,7 +333,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, Ref } from "vue";
|
import { ref, Ref, reactive } 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 {
|
||||||
@@ -364,47 +344,25 @@ import {
|
|||||||
SignedState,
|
SignedState,
|
||||||
ZoomLevel,
|
ZoomLevel,
|
||||||
} from "../../types";
|
} from "../../types";
|
||||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/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";
|
||||||
|
|
||||||
import {
|
// @ts-ignore
|
||||||
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);
|
console.log(PdfWorker); // incredible but this is needed
|
||||||
|
|
||||||
// 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 { download_doc_as_pdf } from "../StoredObjectButton/helpers";
|
import {
|
||||||
|
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";
|
||||||
|
|
||||||
@@ -475,16 +433,6 @@ 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();
|
||||||
@@ -656,15 +604,6 @@ 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) {
|
||||||
@@ -677,7 +616,10 @@ const turnSignature = async (upOrDown: number) => {
|
|||||||
}
|
}
|
||||||
let currentZone = signature.zones[zoneIndex];
|
let currentZone = signature.zones[zoneIndex];
|
||||||
if (currentZone) {
|
if (currentZone) {
|
||||||
selectZoneInCanvas(currentZone);
|
page.value = currentZone.PDFPage.index + 1;
|
||||||
|
const canvas = getCanvas(currentZone.PDFPage.index + 1);
|
||||||
|
selectZone(currentZone, canvas);
|
||||||
|
canvas.scrollIntoView();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -812,7 +754,7 @@ const confirmSign = () => {
|
|||||||
zone: userSignatureZone.value,
|
zone: userSignatureZone.value,
|
||||||
};
|
};
|
||||||
makeFetch("POST", url, body)
|
makeFetch("POST", url, body)
|
||||||
.then(() => {
|
.then((r) => {
|
||||||
checkForReady();
|
checkForReady();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -834,7 +776,9 @@ const undoSign = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const toggleAddZone = () => {
|
const toggleAddZone = () => {
|
||||||
canvasEvent.value = canvasEvent.value === "select" ? "add" : "select";
|
canvasEvent.value === "select"
|
||||||
|
? (canvasEvent.value = "add")
|
||||||
|
: (canvasEvent.value = "select");
|
||||||
};
|
};
|
||||||
|
|
||||||
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
const addZoneEvent = async (e: PointerEvent, canvas: HTMLCanvasElement) => {
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ const open = () => {
|
|||||||
state.opened = true;
|
state.opened = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRestoreVersion = (payload: {
|
|
||||||
newVersion: StoredObjectVersionWithPointInTime;
|
|
||||||
}) => emit("restoreVersion", payload);
|
|
||||||
|
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@@ -46,7 +42,9 @@ defineExpose({ open });
|
|||||||
:versions="props.versions"
|
:versions="props.versions"
|
||||||
:can-edit="canEdit"
|
:can-edit="canEdit"
|
||||||
:stored-object="storedObject"
|
:stored-object="storedObject"
|
||||||
@restore-version="onRestoreVersion"
|
@restore-version="
|
||||||
|
(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="document-list">
|
<div class="col-md-10 col-xxl">
|
||||||
<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,54 @@
|
|||||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
|
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
|
||||||
|
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<!-- person document or accompanying course document -->
|
<div class="item-col" style="width: unset">
|
||||||
<div class="item-two-col-grid">
|
{% if document.object.isPending %}
|
||||||
<div class="title">
|
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
||||||
{% if document.object.isPending %}
|
{% elseif document.object.isFailure %}
|
||||||
<div class="badge text-bg-info" data-docgen-is-pending="{{ document.object.id }}">{{ 'docgen.Doc generation is pending'|trans }}</div>
|
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||||
{% elseif document.object.isFailure %}
|
{% endif %}
|
||||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="denomination h2">
|
{% if context == 'person' and accompanyingCourse is defined %}
|
||||||
{{ document.title|chill_print_or_message("No title") }}
|
|
||||||
</div>
|
|
||||||
{% if document.object.type is not empty %}
|
|
||||||
<div>
|
|
||||||
{{ mm.mimeIcon(document.object.type) }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div>
|
<div>
|
||||||
<p>{{ document.category.name|localize_translatable_string }}</p>
|
<span class="badge bg-primary">
|
||||||
|
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{% if document.object.hasTemplate %}
|
{% elseif context == 'accompanying-period' and person is defined %}
|
||||||
<div>
|
<div>
|
||||||
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
<span class="badge bg-primary">
|
||||||
</div>
|
{{ 'Document from person %name%'|trans({ '%name%': document.person|chill_entity_render_string }) }}
|
||||||
{% endif %}
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
<div class="denomination h2">
|
||||||
|
{{ document.title|chill_print_or_message("No title") }}
|
||||||
</div>
|
</div>
|
||||||
{% if document.date is not null %}
|
{% if document.object.type is not empty %}
|
||||||
<div class="aside">
|
<div>
|
||||||
<div class="dates row text-end">
|
{{ mm.mimeIcon(document.object.type) }}
|
||||||
<span>{{ document.date|format_date('short') }}</span>
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
{% if context == 'person' and accompanyingCourse is defined %}
|
<div>
|
||||||
<div class="text-end">
|
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||||
<span class="badge bg-primary">
|
</div>
|
||||||
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
{% if document.object.hasTemplate %}
|
||||||
</span>
|
<div>
|
||||||
</div>
|
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
||||||
{% 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>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</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>
|
||||||
|
{% 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,15 +62,7 @@ final readonly class RemoveOldVersionMessageHandler implements MessageHandlerInt
|
|||||||
|
|
||||||
$storedObject = $storedObjectVersion->getStoredObject();
|
$storedObject = $storedObjectVersion->getStoredObject();
|
||||||
|
|
||||||
if ($this->storedObjectManager->exists($storedObjectVersion)) {
|
$this->storedObjectManager->delete($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);
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Tests\Controller;
|
|||||||
use Chill\DocStoreBundle\Controller\StoredObjectApiController;
|
use Chill\DocStoreBundle\Controller\StoredObjectApiController;
|
||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
@@ -45,7 +46,9 @@ class StoredObjectApiControllerTest extends TestCase
|
|||||||
{"type": "stored-object", "id": 1}
|
{"type": "stored-object", "id": 1}
|
||||||
JSON);
|
JSON);
|
||||||
|
|
||||||
$controller = new StoredObjectApiController($security, $serializer, $entityManager);
|
$managerRegistry = $this->createMock(ManagerRegistry::class);
|
||||||
|
|
||||||
|
$controller = new StoredObjectApiController($security, $serializer, $entityManager, $managerRegistry);
|
||||||
|
|
||||||
$actual = $controller->createStoredObject();
|
$actual = $controller->createStoredObject();
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ 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());
|
||||||
@@ -52,29 +51,6 @@ 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();
|
||||||
@@ -147,6 +123,6 @@ class DummyStoredObjectManager implements StoredObjectManagerInterface
|
|||||||
|
|
||||||
public function exists(StoredObject|StoredObjectVersion $document): bool
|
public function exists(StoredObject|StoredObjectVersion $document): bool
|
||||||
{
|
{
|
||||||
return true;
|
throw new \RuntimeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,30 +99,3 @@ 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
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
protected array $crudConfig = [];
|
protected array $crudConfig = [];
|
||||||
|
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the role given from the config.
|
* get the role given from the config.
|
||||||
*/
|
*/
|
||||||
@@ -63,6 +65,7 @@ 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,
|
||||||
@@ -212,7 +215,7 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
|
|
||||||
protected function getManagerRegistry(): ManagerRegistry
|
protected function getManagerRegistry(): ManagerRegistry
|
||||||
{
|
{
|
||||||
return $this->container->get('doctrine');
|
return $this->managerRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -225,7 +228,7 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
|
|
||||||
protected function getValidator(): ValidatorInterface
|
protected function getValidator(): ValidatorInterface
|
||||||
{
|
{
|
||||||
return $this->container->get('validator');
|
return $this->get('validator');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\CRUD\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
@@ -23,6 +24,11 @@ use Symfony\Component\Validator\ConstraintViolationListInterface;
|
|||||||
|
|
||||||
class ApiController extends AbstractCRUDController
|
class ApiController extends AbstractCRUDController
|
||||||
{
|
{
|
||||||
|
public function __construct(ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base method for handling api action.
|
* Base method for handling api action.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Entity\Address;
|
use Chill\MainBundle\Entity\Address;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
@@ -20,7 +21,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|||||||
|
|
||||||
class AddressApiController extends ApiController
|
class AddressApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate an existing address.
|
* Duplicate an existing address.
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory;
|
|||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Chill\MainBundle\Repository\AddressReferenceRepository;
|
use Chill\MainBundle\Repository\AddressReferenceRepository;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -26,7 +27,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|||||||
|
|
||||||
final class AddressReferenceAPIController extends ApiController
|
final class AddressReferenceAPIController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {}
|
public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')]
|
#[Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')]
|
||||||
public function search(PostalCode $postalCode, Request $request): JsonResponse
|
public function search(PostalCode $postalCode, Request $request): JsonResponse
|
||||||
|
|||||||
@@ -13,10 +13,16 @@ namespace Chill\MainBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class CivilityApiController extends ApiController
|
class CivilityApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
|
||||||
{
|
{
|
||||||
return $query->addOrderBy('e.order', 'ASC');
|
return $query->addOrderBy('e.order', 'ASC');
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class CountryApiController extends ApiController {}
|
class CountryApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,10 +13,16 @@ namespace Chill\MainBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class GenderApiController extends ApiController
|
class GenderApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $query): void
|
protected function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
$query
|
$query
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class GeographicalUnitApiController extends ApiController {}
|
class GeographicalUnitApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Controller;
|
|||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,6 +22,11 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class LocationApiController extends ApiController
|
class LocationApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $query): void
|
protected function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
$query
|
$query
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,6 +20,11 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class LocationTypeApiController extends ApiController
|
class LocationTypeApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
public function customizeQuery(string $action, Request $request, $query): void
|
public function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
$query->andWhere(
|
$query->andWhere(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory;
|
|||||||
use Chill\MainBundle\Repository\CountryRepository;
|
use Chill\MainBundle\Repository\CountryRepository;
|
||||||
use Chill\MainBundle\Repository\PostalCodeRepositoryInterface;
|
use Chill\MainBundle\Repository\PostalCodeRepositoryInterface;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -26,7 +27,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|||||||
|
|
||||||
final class PostalCodeAPIController extends ApiController
|
final class PostalCodeAPIController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {}
|
public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/main/postal-code/search.json')]
|
#[Route(path: '/api/1.0/main/postal-code/search.json')]
|
||||||
public function search(Request $request): JsonResponse
|
public function search(Request $request): JsonResponse
|
||||||
|
|||||||
@@ -12,10 +12,16 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class ScopeApiController extends ApiController
|
class ScopeApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $query): void
|
protected function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
if ('_index' === $action) {
|
if ('_index' === $action) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use Chill\MainBundle\CRUD\Controller\ApiController;
|
|||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Chill\MainBundle\Security\ChillSecurity;
|
use Chill\MainBundle\Security\ChillSecurity;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
@@ -22,7 +23,10 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
|
|
||||||
class UserApiController extends ApiController
|
class UserApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly ChillSecurity $security) {}
|
public function __construct(private readonly ChillSecurity $security, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])]
|
#[Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])]
|
||||||
public function currentLocation(mixed $_format): JsonResponse
|
public function currentLocation(mixed $_format): JsonResponse
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class UserGroupApiController extends ApiController {}
|
class UserGroupApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,10 +12,16 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class UserJobApiController extends ApiController
|
class UserJobApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $query): void
|
protected function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
if ('_index' === $action) {
|
if ('_index' === $action) {
|
||||||
|
|||||||
@@ -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 LOWER(UNACCENT(ug.label->>?)) LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
OR ug.label->>? LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\')
|
||||||
', [$pattern, $lang, $lang, $pattern]);
|
', [$pattern, $lang, $pattern, $lang]);
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,34 +25,7 @@ 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 {
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ function loadDynamicPicker(element) {
|
|||||||
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
||||||
|
|
||||||
apps.forEach(function (el) {
|
apps.forEach(function (el) {
|
||||||
|
let suggested;
|
||||||
|
let as_id;
|
||||||
|
let submit_on_adding_new_entity;
|
||||||
|
let label;
|
||||||
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
||||||
uniqId = el.dataset.uniqid,
|
uniqId = el.dataset.uniqid,
|
||||||
input = element.querySelector(
|
input = element.querySelector(
|
||||||
@@ -22,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 === "[]") {
|
||||||
|
|||||||
@@ -45,10 +45,6 @@ const onPickGenericDoc = ({
|
|||||||
}) => {
|
}) => {
|
||||||
emit("pickGenericDoc", { genericDoc });
|
emit("pickGenericDoc", { genericDoc });
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
|
||||||
emit("removeAttachment", payload);
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -60,7 +56,7 @@ const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => {
|
|||||||
></pick-generic-doc-modal>
|
></pick-generic-doc-modal>
|
||||||
<attachment-list
|
<attachment-list
|
||||||
:attachments="props.attachments"
|
:attachments="props.attachments"
|
||||||
@removeAttachment="onRemoveAttachment"
|
@removeAttachment="(payload) => emit('removeAttachment', payload)"
|
||||||
></attachment-list>
|
></attachment-list>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -72,14 +72,6 @@ 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 [];
|
||||||
@@ -253,8 +245,10 @@ 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="onPickDocument"
|
@pickGenericDoc="(payload) => emit('pickGenericDoc', payload)"
|
||||||
@removeGenericDoc="onRemoveGenericDoc"
|
@removeGenericDoc="
|
||||||
|
(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">
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
trans(THIRDPARTY_CONTACT_OF)
|
trans(THIRDPARTY_CONTACT_OF)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else-if="props.entity.kind === 'company'">{{
|
<span v-else-if="props.entity.kind === 'company'">{{
|
||||||
trans(THIRDPARTY_A_COMPANY)
|
trans(THIRDPARTY_A_CONTACT)
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else>{{ trans(THIRDPARTY_A_CONTACT) }}</span>
|
<span v-else>{{ $t("thirdparty.contact") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -54,7 +54,6 @@ import {
|
|||||||
ACCEPTED_USERS,
|
ACCEPTED_USERS,
|
||||||
THIRDPARTY_A_CONTACT,
|
THIRDPARTY_A_CONTACT,
|
||||||
THIRDPARTY_CONTACT_OF,
|
THIRDPARTY_CONTACT_OF,
|
||||||
THIRDPARTY_A_COMPANY,
|
|
||||||
PERSON,
|
PERSON,
|
||||||
THIRDPARTY,
|
THIRDPARTY,
|
||||||
} from "translator";
|
} from "translator";
|
||||||
|
|||||||
@@ -136,59 +136,6 @@
|
|||||||
</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">
|
||||||
@@ -445,12 +392,4 @@ 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 %}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ 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 = new Statement();
|
$stmt = Statement::create()
|
||||||
$stmt = $stmt->process($csv);
|
->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 = new Statement();
|
$stmt = Statement::create()
|
||||||
$stmt = $stmt->process($csv, [
|
->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 = new Statement();
|
$stmt = Statement::create()
|
||||||
$stmt = $stmt->process($csv, [
|
->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,8 +54,7 @@ class AddressReferenceLU
|
|||||||
|
|
||||||
private function process_address(Reader $csv, ?string $sendAddressReportToEmail = null): void
|
private function process_address(Reader $csv, ?string $sendAddressReportToEmail = null): void
|
||||||
{
|
{
|
||||||
$stmt = new Statement();
|
$stmt = Statement::create()->process($csv);
|
||||||
$stmt = $stmt->process($csv);
|
|
||||||
foreach ($stmt as $record) {
|
foreach ($stmt as $record) {
|
||||||
$this->addressBaseImporter->importAddress(
|
$this->addressBaseImporter->importAddress(
|
||||||
$record['id_geoportail'],
|
$record['id_geoportail'],
|
||||||
@@ -75,8 +74,7 @@ class AddressReferenceLU
|
|||||||
|
|
||||||
private function process_postal_code(Reader $csv): void
|
private function process_postal_code(Reader $csv): void
|
||||||
{
|
{
|
||||||
$stmt = new Statement();
|
$stmt = Statement::create()->process($csv);
|
||||||
$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,8 +25,6 @@ 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,
|
||||||
@@ -42,13 +40,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(self::LOG_PREFIX.'Workflow was not found!', ['entityWorkflowId' => $workflowId]);
|
$this->logger->alert('Workflow was not found!', [$workflowId]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $workflow->isStaledAt($olderThanDate)) {
|
if (false === $workflow->isStaledAt($olderThanDate)) {
|
||||||
$this->logger->alert(self::LOG_PREFIX.'Workflow has transitioned in the meantime.', ['entityWorkflowId' => $workflowId]);
|
$this->logger->alert('Workflow has transitioned in the meantime.', [$workflowId]);
|
||||||
|
|
||||||
throw new UnrecoverableMessageHandlingException('the workflow is not staled any more');
|
throw new UnrecoverableMessageHandlingException('the workflow is not staled any more');
|
||||||
}
|
}
|
||||||
@@ -69,14 +67,14 @@ final readonly class CancelStaleWorkflowHandler
|
|||||||
'transitionAt' => $this->clock->now(),
|
'transitionAt' => $this->clock->now(),
|
||||||
'transition' => $transition->getName(),
|
'transition' => $transition->getName(),
|
||||||
]);
|
]);
|
||||||
$this->logger->info(self::LOG_PREFIX.'EntityWorkflow has been cancelled automatically.', ['entityWorkflowId' => $workflowId]);
|
$this->logger->info('EntityWorkflow has been cancelled automatically.', [$workflowId]);
|
||||||
$transitionApplied = true;
|
$transitionApplied = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$transitionApplied) {
|
if (!$transitionApplied) {
|
||||||
$this->logger->error(self::LOG_PREFIX.'No valid transition found for EntityWorkflow.', ['entityWorkflowId' => $workflowId]);
|
$this->logger->error('No valid transition found for EntityWorkflow.', [$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,7 +61,6 @@ 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));
|
||||||
|
|||||||
@@ -943,16 +943,6 @@ 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:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ services:
|
|||||||
_defaults:
|
_defaults:
|
||||||
autowire: true
|
autowire: true
|
||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
|
public: false
|
||||||
|
|
||||||
Chill\MainBundle\Controller\:
|
Chill\MainBundle\Controller\:
|
||||||
resource: '../../Controller'
|
resource: '../../Controller'
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
|
|||||||
{
|
{
|
||||||
$now = $this->clock->now();
|
$now = $this->clock->now();
|
||||||
|
|
||||||
if (null !== $cronJobExecution && $now->sub(new \DateInterval('PT23H45M')) < $cronJobExecution->getLastStart()) {
|
if (null !== $cronJobExecution && $now->sub(new \DateInterval('P1D')) < $cronJobExecution->getLastStart()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos
|
|||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
@@ -46,7 +47,10 @@ use Symfony\Component\Workflow\Registry;
|
|||||||
|
|
||||||
final class AccompanyingCourseApiController extends ApiController
|
final class AccompanyingCourseApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) {}
|
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, protected ManagerRegistry $managerRegistry, private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
public function commentApi($id, Request $request, string $_format): Response
|
public function commentApi($id, Request $request, string $_format): Response
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -204,25 +204,20 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
|
|||||||
['date' => 'DESC', 'id' => 'DESC'],
|
['date' => 'DESC', 'id' => 'DESC'],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$activities = \array_slice($activities, 0, 3);
|
||||||
|
|
||||||
$works = $this->workRepository->findByAccompanyingPeriod(
|
$works = $this->workRepository->findByAccompanyingPeriod(
|
||||||
$accompanyingCourse,
|
$accompanyingCourse,
|
||||||
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
||||||
3
|
3
|
||||||
);
|
);
|
||||||
|
|
||||||
$counters = [
|
|
||||||
'activities' => count($activities),
|
|
||||||
'openWorks' => count($accompanyingCourse->getOpenWorks()),
|
|
||||||
'works' => count($works),
|
|
||||||
];
|
|
||||||
|
|
||||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||||
'accompanyingCourse' => $accompanyingCourse,
|
'accompanyingCourse' => $accompanyingCourse,
|
||||||
'withoutHousehold' => $withoutHousehold,
|
'withoutHousehold' => $withoutHousehold,
|
||||||
'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(),
|
'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(),
|
||||||
'works' => $works,
|
'works' => $works,
|
||||||
'activities' => \array_slice($activities, 0, 3),
|
'activities' => $activities,
|
||||||
'counters' => $counters,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
use Chill\MainBundle\Serializer\Model\Counter;
|
use Chill\MainBundle\Serializer\Model\Counter;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
@@ -27,7 +28,10 @@ class AccompanyingCourseWorkApiController extends ApiController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository,
|
private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository,
|
||||||
private readonly Security $security,
|
private readonly Security $security,
|
||||||
) {}
|
ManagerRegistry $managerRegistry,
|
||||||
|
) {
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
#[Route(path: '/api/1.0/person/accompanying-period/work/my-near-end')]
|
#[Route(path: '/api/1.0/person/accompanying-period/work/my-near-end')]
|
||||||
public function myWorksNearEndDate(Request $request): JsonResponse
|
public function myWorksNearEndDate(Request $request): JsonResponse
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class AccompanyingPeriodCommentApiController extends ApiController {}
|
class AccompanyingPeriodCommentApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class AccompanyingPeriodResourceApiController extends ApiController {}
|
class AccompanyingPeriodResourceApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ use Chill\PersonBundle\Event\Person\PersonAddressMoveEvent;
|
|||||||
use Chill\PersonBundle\Repository\Household\HouseholdACLAwareRepositoryInterface;
|
use Chill\PersonBundle\Repository\Household\HouseholdACLAwareRepositoryInterface;
|
||||||
use Chill\PersonBundle\Repository\Household\HouseholdRepository;
|
use Chill\PersonBundle\Repository\Household\HouseholdRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -31,7 +32,10 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
|||||||
|
|
||||||
class HouseholdApiController extends ApiController
|
class HouseholdApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository, protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\HttpFoundation\JsonResponse
|
* @return \Symfony\Component\HttpFoundation\JsonResponse
|
||||||
|
|||||||
@@ -13,10 +13,16 @@ namespace Chill\PersonBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class HouseholdCompositionTypeApiController extends ApiController
|
class HouseholdCompositionTypeApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param QueryBuilder $query
|
* @param QueryBuilder $query
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ use Chill\PersonBundle\Repository\Household\PositionRepository;
|
|||||||
use Chill\PersonBundle\Repository\PersonRepository;
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
@@ -47,9 +48,10 @@ class HouseholdMemberController extends ApiController
|
|||||||
private readonly HouseholdRepository $householdRepository,
|
private readonly HouseholdRepository $householdRepository,
|
||||||
private readonly Security $security,
|
private readonly Security $security,
|
||||||
private readonly PositionRepository $positionRepository,
|
private readonly PositionRepository $positionRepository,
|
||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
|
||||||
protected ParameterBagInterface $parameterBag,
|
protected ParameterBagInterface $parameterBag,
|
||||||
|
ManagerRegistry $managerRegistry,
|
||||||
) {
|
) {
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
$this->household_fields_visibility = $parameterBag->get('chill_person.household_fields');
|
$this->household_fields_visibility = $parameterBag->get('chill_person.household_fields');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,16 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class OpeningApiController extends ApiController
|
class OpeningApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $qb): void
|
protected function customizeQuery(string $action, Request $request, $qb): void
|
||||||
{
|
{
|
||||||
$qb->where($qb->expr()->gt('e.noActiveAfter', ':now'))
|
$qb->where($qb->expr()->gt('e.noActiveAfter', ':now'))
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Chill\PersonBundle\Security\AuthorizedCenterOnPersonCreationInterface;
|
use Chill\PersonBundle\Security\AuthorizedCenterOnPersonCreationInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -32,7 +33,9 @@ class PersonApiController extends ApiController
|
|||||||
private readonly AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation,
|
private readonly AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation,
|
||||||
private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||||
ParameterBagInterface $parameterBag,
|
ParameterBagInterface $parameterBag,
|
||||||
|
ManagerRegistry $managerRegistry,
|
||||||
) {
|
) {
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
$this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
|
$this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,5 +12,12 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
class RelationApiController extends ApiController {}
|
class RelationApiController extends ApiController
|
||||||
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,12 +15,16 @@ use Chill\MainBundle\CRUD\Controller\ApiController;
|
|||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Repository\Relationships\RelationshipRepository;
|
use Chill\PersonBundle\Repository\Relationships\RelationshipRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class RelationshipApiController extends ApiController
|
class RelationshipApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly RelationshipRepository $repository) {}
|
public function __construct(private readonly RelationshipRepository $repository, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ParamConverter("person", options={"id": "person_id"})
|
* @ParamConverter("person", options={"id": "person_id"})
|
||||||
|
|||||||
@@ -13,10 +13,16 @@ namespace Chill\PersonBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class SocialIssueApiController extends ApiController
|
class SocialIssueApiController extends ApiController
|
||||||
{
|
{
|
||||||
|
public function __construct(protected ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
protected function customizeQuery(string $action, Request $request, $query): void
|
protected function customizeQuery(string $action, Request $request, $query): void
|
||||||
{
|
{
|
||||||
$query->where(
|
$query->where(
|
||||||
|
|||||||
@@ -16,12 +16,16 @@ use Chill\MainBundle\Pagination\PaginatorFactory;
|
|||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Repository\SocialWork\GoalRepository;
|
use Chill\PersonBundle\Repository\SocialWork\GoalRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class SocialWorkGoalApiController extends ApiController
|
class SocialWorkGoalApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) {}
|
public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
public function listBySocialAction(Request $request, SocialAction $action): Response
|
public function listBySocialAction(Request $request, SocialAction $action): Response
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,12 +16,16 @@ use Chill\MainBundle\Serializer\Model\Collection;
|
|||||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Repository\SocialWork\ResultRepository;
|
use Chill\PersonBundle\Repository\SocialWork\ResultRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class SocialWorkResultApiController extends ApiController
|
class SocialWorkResultApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly ResultRepository $resultRepository) {}
|
public function __construct(private readonly ResultRepository $resultRepository, ManagerRegistry $managerRegistry)
|
||||||
|
{
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
public function listByGoal(Request $request, Goal $goal): Response
|
public function listByGoal(Request $request, Goal $goal): Response
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory;
|
|||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\Clock\ClockInterface;
|
use Symfony\Component\Clock\ClockInterface;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -26,7 +27,10 @@ final class SocialWorkSocialActionApiController extends ApiController
|
|||||||
private readonly SocialIssueRepository $socialIssueRepository,
|
private readonly SocialIssueRepository $socialIssueRepository,
|
||||||
private readonly PaginatorFactory $paginator,
|
private readonly PaginatorFactory $paginator,
|
||||||
private readonly ClockInterface $clock,
|
private readonly ClockInterface $clock,
|
||||||
) {}
|
ManagerRegistry $managerRegistry,
|
||||||
|
) {
|
||||||
|
parent::__construct($managerRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
public function listBySocialIssueApi($id, Request $request)
|
public function listBySocialIssueApi($id, Request $request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -511,14 +511,6 @@ class AccompanyingPeriod implements
|
|||||||
return $this->getParticipationsContainsPerson($person)->count() > 0;
|
return $this->getParticipationsContainsPerson($person)->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOpenWorks(): Collection
|
|
||||||
{
|
|
||||||
return $this->getWorks()->filter(
|
|
||||||
static fn (AccompanyingPeriodWork $work): bool => null === $work->getEndDate()
|
|
||||||
or $work->getEndDate() > new \DateTimeImmutable('today')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a new participation for a person.
|
* Open a new participation for a person.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -58,11 +58,13 @@ class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterfa
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||||
private ?int $numberOfChildren = null;
|
private ?int $numberOfChildren = null;
|
||||||
|
|
||||||
|
#[Assert\NotNull]
|
||||||
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
||||||
#[Serializer\Groups(['docgen:read'])]
|
#[Serializer\Groups(['docgen:read'])]
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||||
private ?int $numberOfDependents = null;
|
private ?int $numberOfDependents = null;
|
||||||
|
|
||||||
|
#[Assert\NotNull]
|
||||||
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
#[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])]
|
||||||
#[Serializer\Groups(['docgen:read'])]
|
#[Serializer\Groups(['docgen:read'])]
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Accompanying Course Comments'), [
|
$menu->addChild($this->translator->trans('Accompanying Course Comment'), [
|
||||||
'route' => 'chill_person_accompanying_period_comment_list',
|
'route' => 'chill_person_accompanying_period_comment_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'accompanying_period_id' => $period->getId(),
|
'accompanying_period_id' => $period->getId(),
|
||||||
@@ -80,15 +80,12 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $period)) {
|
if ($this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $period)) {
|
||||||
$menu->addChild($this->translator->trans('Accompanying Course Actions'), [
|
$menu->addChild($this->translator->trans('Accompanying Course Action'), [
|
||||||
'route' => 'chill_person_accompanying_period_work_list',
|
'route' => 'chill_person_accompanying_period_work_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $period->getId(),
|
'id' => $period->getId(),
|
||||||
], ])
|
], ])
|
||||||
->setExtras([
|
->setExtras(['order' => 40]);
|
||||||
'order' => 40,
|
|
||||||
'counter' => count($period->getOpenWorks()) > 0 ? count($period->getOpenWorks()) : null,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user