- Updated the `UpdateProfileCommand` to use `\Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber` instead of the deprecated `PhonenumberConstraint`.
- Removed unused `PhonenumberConstraint` imports from relevant files.
- Introduced an in-memory cache to store and reuse created or found motives during import, reducing redundant database operations.
- Updated the logic to ensure parent motives are created or retrieved via the cache.
- Modified the test suite to verify parent and child motive relationships with deduplication.
- Ensured labels are consistently formatted and trimmed during the import process.
- Extended motive import logic to parse and set the "ordering" field from YAML.
- Ensured invalid "ordering" values throw a runtime exception.
- Updated test cases to verify "ordering" is correctly set for child and standalone motives.
- Verified parent motives retain default "ordering" value (0).
- Trimmed labels during motive import to ensure consistent formatting.
- Introduced logic to parse and handle "parent > child" syntax in motive names.
- Automatically creates and links parent motives if they don't exist.
- Added test case to verify parent-child relationship creation and linking.
FIX: Frontend: La liste des motifs reste vide et Frontend: l'appelant apparait deux fois dans les suggestions
See merge request Chill-Projet/chill-bundles!917
Améliorer l'affichage de la hiérarchie des motifs et ajouter une checkbox « Afficher uniquement les commentaires ».
See merge request Chill-Projet/chill-bundles!903
- Added Symfony container XML and PHP paths to the configuration.
- Set levels for dead code, code quality, type coverage, docblocks, and coding style.
- Updated `ChillTwigRoutingHelper` to extend `AbstractExtension` for consistency with Twig best practices.
- Moved `chill_return_path_label` from a Twig attribute to a filter within `getFilters`.
- Removed unnecessary dependency on `RequestStack` in `services/templating.yaml`.
- Added `SetList::PHP_80` to `SetList::PHP_84` for advanced PHP version support.
- Enhanced compatibility by incorporating broader PHP syntax improvements.
- Updated `.gitlab-ci.yml` to use `chill/base-image:8.4-edge` across all stages.
- Updated `composer.json` to require PHP `^8.4` and upgraded `lexik/jwt-authentication-bundle` to `^3.1.1`.
- Replaced `JWTTokenAuthenticator` with `JWTAuthenticator` for compatibility with updated security components.
- Updated constructor to use `UserProviderInterface` instead of `TokenStorageInterface`.
- Enhanced `getTokenExtractor` with correct return type declaration.
- Consolidated configurations using `RectorConfig::configure()` method.
- Simplified paths and enabled Composer-based configuration for Twig, Doctrine, and Symfony.
- Replaced deprecated `createFromPath` and `createFromStream` methods with `from`.
- Updated all relevant commands, services, controllers, and exporters.
- Corrected `routeParameters` assignment in `MenuComposer` for proper parameter usage.
- Adjusted `menus` and `routes` assignment order in `MenuTwig` for consistent handling.
- Added a `README.md` file in `resources/ticket_motives_import/` to explain the command's usage.
- Included a sample `motives.yaml` file with predefined ticket motives for importing.
- Introduced a Symfony console command `chill:main:override_translation` to apply YAML-defined translation overrides.
- Added an example configuration file in `resources/translation_override/` to illustrate usage.
- Updated service definitions to register the new command.
Correction de bugs, ajout champs urgents dans la modal d'initialisation du ticket et ajout d'un configuration pour l'affichage des tabs dans la homepage
See merge request Chill-Projet/chill-bundles!884
- Inject parameters directly instead of getting from container
- User PasswordHasher instead of EncoderFactory
- set parameters directly and correctly encode values to json
- Add code snippet to avoid circular reference in SocialActionNormalizer.php, AccompanyingPeriodWorkEvaluationDocumentNormalizer.php, AccompanyingPeriodWorkEvaluationNormalizer.php, and AccompanyingPeriodWorkNormalizer.php
- Add `readonly` class and typed method return values
- Replace `LifecycleEventArgs` with specific `PrePersistEventArgs` and `PreUpdateEventArgs`
- Simplify `DateTimeImmutable` instantiation
- Enhance user retrieval using variable assignment for type-checking
- Replace manual tracking of createdAt, createdBy, updatedAt, updatedBy with TrackCreationTrait and TrackUpdateTrait
- Remove related properties and methods
refactor: add type hints and improve method signatures
- add return type declarations to methods in `ExportGenerationVoter`
- add type hints to `EntityToJsonTransformer` methods
- include `ExceptionInterface` in `EntityToJsonTransformer` for better error handling
```
Updated references from Symfony\Component\Security\Core\Security
to Symfony\Bundle\SecurityBundle\Security across multiple files
to align with the updated namespace and improve compatibility.
- Changed import path for ThirdParty type in TypeThirdParty.vue and updated its usage.
- Refactored PersonText.vue to import Person and AltName types from ChillPersonAssets.
- Updated types.ts in ChillThirdPartyBundle to include a new 'type' field in the Thirdparty interface.
- Modified TicketBundle types to accommodate Thirdparty type in CallerState.
- Adjusted AddresseeSelectorComponent.vue to use 'thirdparty' instead of 'third_party'.
- Refined BannerComponent.vue to improve readability and maintainability.
- Updated CallerSelectorComponent.vue to reflect changes in entity types.
- Enhanced TicketHistoryListComponent.vue to handle both Person and Thirdparty types.
- Refactored TicketHistoryPersonComponent.vue to accept both Person and Thirdparty entities.
Integrated the `StateHistory` entity to manage state transitions in tickets and the `StateEnum` for defining state values (`open`, `closed`). Updated `Ticket` to handle associations with state histories and provide state management methods. Added migration for `state_history` table and extended `TicketTest` for state-related tests.
Added detailed setup instructions, including Docker and asset management steps. Updated guidelines on testing structure, code quality tools, debugging, and deployment processes. Enhanced clarity and streamlined processes for developers. Updated `TicketTest` with additional tests for `externalRef`.
Updated the dependency from node-sass to sass to ensure compatibility with modern tooling and resolve deprecation warnings. This change aligns with recommended practices for Sass-related workflows.
This update introduces a new path alias, "ChillPersonAssets/*", to the tsconfig.json file. It allows TypeScript to resolve imports for assets within the ChillPersonBundle more efficiently.
Rewrote the "create a new bundle" guide for clarity and completeness. Added detailed steps for creating a bundle class, registering namespaces in `composer.json`, updating configuration files, and dumping autoload. These changes aim to make the instructions easier to follow for new developers.
ChillTicketBundle is now registered in `composer.json`, `bundles.php`, and `doctrine_migrations_chill.yaml`. This integration ensures its autoloading, enables its functionality across environments, and sets up its migration paths.
The export download script was refactored to use ES6 syntax and webpack's modular system. This included separating out the download script into its own file for better organization, removing globally-scoped JavaScript, and adding the new download script as a webpack entry point. Also, the import method for the 'mime' library was adjusted to use ES6 syntax.
Reworked the ticket history interface and added new functionalities. The history interface now supports multiple patients and shows changes in patients' state. Additionally, new ticket creation is now displayed in the history line, along with the creator information. Some minor textual changes were made to reflect support for multiple patients. Implemented code cleanup and removed debug statements for a cleaner codebase.
This commit adds the functionality to set and change the concerned persons in a ticket within the ChillTicketBundle. New vuejs components, serializers, and store modules have been introduced to achieve this. Moreover, necessary changes have been made in existing components and store index to support this functionality.
This commit adds a new file, chill_ticket.yaml, under the tests/app/config/routes directory in the ChillTicketBundle. This file is used to define the routes for the ChillTicket application.
This commit involves the deletion of ChillEventBundle from the bundles configuration. Additionally, test framework configurations are handled in a consolidated manner by moving assets configurations (json_manifest_path) from test/framework.yaml to framework.yaml. The obsolete test/framework.yaml has been deleted as it is no longer needed.
A new file, TicketListControllerTest.php, has been added to the test suite. This file includes tests to ensure that the TicketList controller is working as expected, including checking the successful response of the 'GET' request.
This change replaces the usage of person-render-box component with the on-the-fly component in the BannerComponent.vue file of ChillTicketBundle. Also, OnTheFly component is now being imported. This update simplifies the structure and improves the readability of the code.
Updated the SCSS for badge components, including the introduction of a margin and specific font-weight for user-group badges. Additionally, changes have been made to the TicketApp store to comment out a specific condition. A few updates were made to the twig files in the ChillTicketBundle and ChillMainBundle to reflect these style changes.
Refactored BannerComponent to use an imported date function, improved time calculation logic, and enhanced code readability. Also, updated TicketNormalizer to properly normalize various datetime and user-related fields. A new date validation check has been added in the date utility file.
This commit refactors the management of addressees history in the ticketing system. Instead of individual addition and removal events for addressees, a new event 'addressees_state' is introduced to capture the state of addressees at any given point in the history. The structure and logic of normalized tickets have been adjusted accordingly.
This commit introduces support for a return path query parameter during ticket creation and editing operations. This enables a more user-friendly redirection after a form submission operation where the return path provides more context on the next page. The return path is now also considered in the Vue.js components, with necessary checks and validations. A 'Cancel' button has been added to the ActionToolbarComponent.vue where the return path exists.
Added a new functionality for listing tickets with the ability for the user to order the list. A method was added to the User class to identify if an object is an instance of User. Similarly, a method was added to the UserGroup class. User.php, UserGroup.php, TicketRepository.php, and TicketRepositoryInterface.php were updated. A new TicketListController, MotiveRepository, and SectionMenuBuilder were created. Translations were included, and services.yaml was updated.
A new UserGroupRender class was added to manage the templating logic for UserGroup entities. The UserGroupRenderInterface was also created, extending the ChillEntityRenderInterface. Additionally, a Twig template for rendering user groups was added.
The "updatedAt" field and "getUpdatedAt" method, as well as the "createdBy" field and the "getCreatedBy" method have been removed from the Ticket entity. These fields and related methods were not necessary and their removal simplifies the entity structure.
The import of the address list has been upgraded to use the latest version of the compiled addresses from Belgian-best-address. In the AddressReferenceBEFromBestAddress class, the RELEASE constant has been updated to point to the v1.1.1 tag.
Changed the first argument in the `createNamedBuilder` method from `null` to an empty string. This adjustment ensures the form factory correctly creates the builder in the SearchController.
Added a new method in PersonRepository to allow querying people by phone number. Also, a new REST API endpoint "/public/api/1.0/ticket/find-caller" was introduced and it can find a caller by their phone number. Accompanied this feature addition with corresponding test cases.
The PhoneNumberUtil has been replaced with PhonenumberHelper in AssociateByPhonenumberCommandHandler and its test class. The purpose of this change is to improve phone number parsing which is now delegated to the PhonenumberHelper class in the Chill\MainBundle\Phonenumber namespace. As a consequence, the related dependencies in both the service and the test class have been updated accordingly.
Added a new method 'parse' in the PhonenumberHelper class in ChillMainBundle to sanitize and parse phone numbers. This method specifically handles phone numbers that start with '00', '+' or '0'. Associated unit tests for this new method were also added in PhonenumberHelperTest.php.
This update extends the tickets serialization and normalisation process to include addressee history. With the changes, AddresseeHistory class now also keeps track of who removed an addressee. Additional types, tests and interfaces have been introduced to support this change.
The updates introduce tracking for the history of addressees in the ticket system, both when added and when removed. The user who removed an addressee is now recorded. The changes also ensure these updated aspects are correctly normalized and users can see them in the ticket history. A new database migration file was created for the changes.
This update introduces a new feature allowing end-users to add a single addressee to a ticket without removing the existing ones. This was achieved by adding a new API endpoint and updating the SetAddresseesController to handle the addition of a single addressee. Accompanying tests have also been provided to ensure the new feature works as expected.
This update includes the implementation of methods to add and retrieve addressee history in the Ticket entity, a handler for addressee setting command, denormalizer for transforming request data to SetAddresseesCommand, and corresponding tests. Additionally, it adds a SetAddresseesController for handling addressee related requests and updates the API specifications.
This commit introduces new fields to the UserGroup entity, specifically background color, foreground color, and an exclusion key. These have been implemented both in the PHP entity and TypeScript interface definitions. Additionally, a Doctrine migration has been created to reflect these changes on the database side.
La validation introduit plusieurs fonctionnalités liées à la gestion du motif du ticket dans le bundle Chill-TicketBundle :
- Ajoute la possibilité de remplacer le motif d'un ticket par un nouveau.
- Fournit des fonctionnalités de gestion de l'historique des motifs du ticket.
- Implémente les modifications pertinentes au niveau du contrôleur, du gestionnaire d'actions et de l'entité.
- Intègre de nouvelles points d'API et met à jour le fichier de spécification de l'API pour la nouvelle fonctionnalité.
- Inclut des tests pour garantir le bon fonctionnement de la nouvelle fonctionnalité.
A new controller, 'AddCommentController', has been added. This controller implements the 'AddCommentCommandHandler', allowing users to add comments to tickets. Additionally, corresponding test cases were implemented. The Ticket entity was also updated to accept and manage comments. API endpoint specs were updated to reflect these changes.
The commit introduces several features related to ticket motive management in the Chill-TicketBundle:
- Adds capability to replace a ticket's motive with a new one.
- Provides ticket motive history management features.
- Implements relevant changes in Controller, Action Handler, and Entity levels.
- Incorporates new API endpoints and updates the API specification file for the new feature.
- Includes tests to ensure the new functionality works as expected.
The commit includes the ChillTicketBundle in the bundles configuration file for testing. Additionally, the autoload-dev directive in the composer.json file was updated to include the "App" namespace for testing purposes. This ensures that the tests related to the "App" namespace are correctly autoloaded.
This update introduces the Motive API Controller to the ChillTicket bundle with its corresponding service configuration. Also included are related data fixtures for loading motive information. The motive entity has been updated to improve its serialization properties and new types were added to the TypeScript definitions of the bundle.
This update introduces new features allowing the creation of tickets and associating them with a phone number. Specifically, relevant commands and their handlers have been created along with corresponding tests. An endpoint for ticket creation has also been set up, and the ViewTicketController has been renamed and refactored to EditTicketController to better reflect its function.
A new function, findByPhone, has been added to the PersonACLAwareRepository. This function allows searching for people based on their phone numbers. Changes also reflect in the PersonACLAwareRepositoryInterface, and new test cases have been added to the PersonACLAwareRepositoryTest.
* ([#478](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/478)) Add filtering to admin lists: social actions, social issues, goals, results, and evaluations
### Fixed
* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Fix migration query after previous fix
When writing tests, only test specific files. Do not run all tests or the full
@@ -363,6 +363,8 @@ The project can be deployed in a production environment following Symfony's depl
Comprehensive documentation is available in the `/docs/` directory, including installation instructions, configuration guides, and operational procedures.
This documentation is written using the mkdocs tool.
## Development Workflow
1. **Create a Feature Branch**: Always create a new branch for your feature or bugfix
@@ -6,16 +6,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v4.11.0 - 2025-12-17
### Feature
* ([#478](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/478)) Add filtering to admin lists: social actions, social issues, goals, results, and evaluations
### Fixed
* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Fix migration query after previous fix
* Fix translation key/value
Cannot start with % and should be wrapped in "".
## v4.10.1 - 2025-12-11
### Fixed
* Fix missing translation variable in NewLocation component
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
# Create a new bundle {#create-new-bundle}
###### Create a new bundle
:::: warning
::: title
Warning
:::
Create your own bundle is not a trivial task.
This part of the doc is not yet tested
::::
The easiest way to achieve this is seems to be :
## Create a new directory with Bundle class
1. Prepare a fresh installation of the chill project, in a new directory
2. Create a new bundle in this project, in the src directory
3. Initialize a git repository **at the root bundle**, and create your initial commit.
4. Register the bundle with composer/packagist. If you do not plan to distribute your bundle with packagist, you may use a custom repository for achieve this [#f1]_
5. Move to a development installation, made as described in the [installation-for-development` section, and add your new repository to the composer.json file
6. Work as :ref:`usual ](editing-code-and-commiting.md)
This static method returns an array of menu keys that this builder supports. For example, if you want to add items to the "person" menu:
```php
publicstaticfunctiongetMenuIds():array
{
return['person'];
}
```
*`order` (mandatory): the order in the menu. It is preferrable to increment by far more than 1.
*`label` (mandatory): a translatable string.
*`helper` (optional): a text to help people to understand what does the menu do. Not used in default implementation.
*`condition` (optional): an `Expression Language <http://symfony.com/doc/current/components/expression_language/index.html> `_ which will make the menu appears or not. Typically, it may be used to say "show this menu only if the person concerned is more than 18". **Not implemented yet**.
*`access` (optional): an Expression Language to evalute the possibility, for the user, to show this menu according to Access Control Model. **Not implemented yet.**
### The `buildMenu` method
You may add additional keys, but should not use the keys described above.
The `buildMenu` method is called when a menu with one of the supported keys is rendered.
Currently, you may pass arguments globally to each menu, and they will be all passed to route url. This means that :
You can order menu items using the `order` extra. In case of duplicate orders, the entry is kept, but the order between items with the same weight is random.
* the argument name in the route entry must match the argument key in the menu declaration in the twig template
* if an argument is missing to generate an url, the url generator will throw a `Symfony\Component\Routing\Exception\MissingMandatoryParametersException`
* if the argument name is not declared in route entry, it will be added to the url, (example: `/my/route?additional=foo`)
```php
$menu->addChild('Ordered Item',[/* ... */])
->setExtras(['order'=>50]);
```
### Adding a counter
You can add a counter to a menu item by setting the `counter` extra:
You can add an icon to a menu item by setting the `icon` extra. The icon name corresponds to a [Fork Awesome](https://forkaweso.me/Fork-Awesome/icons/) icon name (without the `fa-` prefix).
```php
$menu->addChild('My tasks',[
'route'=>'chill_task_singletask_my_tasks',
])
->setExtras([
'order'=>-10,
'icon'=>'tasks',
]);
```
Currently, icons are extracted from Fork Awesome, but this might change in the future.
## Existing Menus
Here are some common menus used in Chill and the parameters they receive:
*`person`: Parameter `person` (instance of `Chill\PersonBundle\Entity\Person`). Used in the person file.
*`accompanyingCourse`: Parameter `accompanyingCourse` (instance of `Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriod`). Used in the accompanying course file.
*`admin`: The main administration menu.
*`section`: The "sections" menu (top navigation).
*`user`: The "my menu" (user profile/actions).
*`household`: Parameter `household` (instance of `Chill\PersonBundle\Entity\Household\Household`). Used in the household file.
## Good Examples
For more complex implementations, you can refer to:
In Chill, some entities can be normalized in the `docgen` format, which is specifically used for document generation.
## The `docgen` Format Requirements
This format has specific requirements regarding `null` values. When serializing a `null` value, it must not be serialized as a literal `null`. Instead, it must be serialized as an object (or array) containing all the keys that would be present if the object were not null.
Each key must have, as value:
- An empty string value (for scalars).
- A boolean
- An empty array (for collections).
- Or, if the expected type is another object, it must contain all the keys for that object, recursively.
This ensures that the document generator always finds the expected keys, even if the data is missing.
Additionally, every normalized form must include an `isNull` key (boolean). This helps the document template distinguish between an actual object and its "null" representation.
## Attribute-Based Normalization
The simplest way to support `docgen` normalization is to use Symfony Serializer attributes.
- Use the group `docgen:read` on properties that should be included.
- For translatable fields (stored as JSON/array of translations), you must also add the context `is-translatable => true`.
To avoid side effects and optimize performance, you must return `'*' => false` along with the specific class.
```php
public function getSupportedTypes(?string $format): array
{
if ('docgen' === $format) {
return [
MyEntity::class => true,
'*' => false,
];
}
return [];
}
```
3. **Handle `null` in `normalize`**:
The `normalize` method must detect when the input is `null` and return the "empty" structure with all keys.
### Using `NormalizeNullValueHelper`
To help with normalizing `null` values recursively, you can use the `\Chill\DocGeneratorBundle\Serializer\Helper\NormalizeNullValueHelper` class.
This helper takes an array defining the keys and their expected types. If a type is a class-string, it will call the serializer again to normalize a `null` value for that class.
### Example: `AddressNormalizer.php`
The `AddressNormalizer` is a good example of a custom normalizer handling `docgen`:
```php
class AddressNormalizer implements NormalizerInterface, NormalizerAwareInterface
{
use NormalizerAwareTrait;
private const array NULL_VALUE = [
'address_id' => 'int',
'text' => 'string',
'street' => 'string',
// ...
'validFrom' => \DateTimeInterface::class,
'postcode' => PostalCode::class,
];
public function normalize($address, $format = null, array $context = []): array
// ... supportsNormalization and getSupportedTypes as described above
}
```
## Testing `docgen` Normalization
To ensure that your normalizer strictly follows the `docgen` requirements, you should extend `\Chill\DocGeneratorBundle\Test\DocGenNormalizerTestAbstract`.
This abstract test class performs several critical checks:
- It ensures that the normalized form of a non-null object and a `null` value have **exactly the same keys** (same array shape).
- It verifies that the `isNull` key is present and correctly set (`false` for objects, `true` for `null`).
- It recursively checks that sub-objects also have consistent keys.
- It ensures that `null` values are never returned (they should be empty strings, empty arrays, etc.).
### Example Test: `AddressDocGenNormalizerTest.php`
You need to implement two methods: `provideNotNullObject()` and `provideDocGenExpectClass()`.
In this directory, you find an example of file for the command `chill:main:ticket_motives_import`.
This file contains a list of ticket motives to import into the system. Each entry is a dictionary with two keys: `code` and `label`. The `code` key contains the unique code for the ticket motive, and the `label` key contains the human-readable label for the ticket motive.
The `stored_objects` key contains the documents that will be associated with the tickets. They must be found in the same directory.
The command `chill:main:ticket_motives_import` uses this file to import the specified ticket motives into the system.
In this directory, you find an example of file for the command `chill:main:override_translation`.
This file contains a list of translations to override in the translation catalogue. Each entry is a dictionary with two keys: `from` and `to`. The `from` key contains the original translation string, and the `to` key contains the replacement string.
The command `chill:main:override_translation` uses this file to generate a new translation catalogue with the specified overrides applied.
// if social issues are invisible then social actions cannot be optional or required + if social issues are optional then social actions shouldn't be required
@@ -461,11 +461,17 @@ class ActivityType
{
$property=$field.'Visible';
if(!property_exists($this,$property)){
// Get the real class name (not the proxy)
$class=static::class;
if(str_contains($class,'__CG__')){
$class=get_parent_class($this);
}
$realClass=$class;
if(!property_exists($realClass,$property)){
thrownew\InvalidArgumentException('Field "'.$field.'" not found');
@@ -154,7 +154,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
returnActivityStatsVoter::LISTS;
}
publicfunctionsupportsModifiers()
publicfunctionsupportsModifiers():array
{
returnarray_merge(
$this->helper->supportsModifiers(),
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.