Compare commits

..

271 Commits

Author SHA1 Message Date
cf36070c82 Remove unused @symfony/ux-translator dependency from package.json. 2025-06-18 12:08:22 +02:00
8ee836eec3 Merge remote-tracking branch 'origin/359-fusion-accompanying-period-work' into testing-202505 2025-06-18 12:07:46 +02:00
388030952b Merge remote-tracking branch 'origin/testing-202505' into testing-202505 2025-06-18 12:00:46 +02:00
82a08f1e27 Merge branch '339-partage-d'export-enregistré' into testing-202505
# Conflicts:
#	src/Bundle/ChillPersonBundle/Resources/public/types.ts
2025-06-18 12:00:05 +02:00
925fbaed6d Fix CS 2025-06-18 11:56:20 +02:00
c407c3029f Extend ReferrerFilter to render user descriptions and handle "me" referrers in export data generation. 2025-06-18 11:55:58 +02:00
81b6ae193c Refactor removeUserNotRelatedToJob logic to improve SQL clarity and handle edge cases
We remove the user from the group if the user is deactivated, or of the user does not have any job_history line currently, or if the userjob_id is null in the job_history.
2025-06-18 11:34:32 +02:00
51168ac3c4 In SocialActionFilter, mention the social issue and if a social action is deactivated
All the social action are shown, even the deactivated. So, we append the fact the the social action is also deactivated. We added option in SocialActionRender to achieve this.
2025-06-17 17:45:26 +02:00
12ee091d09 Translate 'Download export' title in wait.html.twig. 2025-06-17 17:10:15 +02:00
49607e431f Set ON DELETE SET NULL for savedExport foreign key in ExportGeneration entity and related migration 2025-06-17 16:20:14 +02:00
ea4cbfe3b9 Update PHPStan configuration to store cache into var directory 2025-06-17 16:19:48 +02:00
9d00b8ae60 Enable filtering statistics by center in Chill configuration: set the default value in config
Set the default value in configuration file. This improves the readability of multiple options.
2025-06-17 16:06:27 +02:00
00350b9efc Refactor scope condition logic in FilterListAccompanyingPeriodHelper
Replaced inline string interpolation with `sprintf` for scope conditions and added user-based condition handling. Introduced new user-specific parameters to enhance query flexibility. Removed unused `AuthorizationHelperForCurrentUserInterface` import.
2025-06-17 16:05:56 +02:00
9a50dad671 Update authorization helper interface in export classes
Replaced `AuthorizationHelperForCurrentUserInterface` with the more generic `AuthorizationHelperInterface` in tests and export helpers. Adjusted method signatures to include the `User` parameter for scope retrieval. Removed unused `centers` mapping in `ListActivity`.
2025-06-17 15:35:04 +02:00
4206d17345 Add debug logging for SQL query execution during export process 2025-06-17 14:25:57 +02:00
110a2e894f Cast exportId to string in logging for consistent logging output 2025-06-17 12:11:11 +02:00
a0daf4428f Merge branch 'master' into 339-partage-d'export-enregistré 2025-06-17 12:05:27 +02:00
f78b8cad9c Cast exportId to string in OnExportGenerationFails logging 2025-06-17 10:39:59 +02:00
6b0c85cdf0 Normalize form data by converting entities using normalizeDoctrineEntity and support array input in denormalizeStringRepresentation. 2025-06-17 10:39:13 +02:00
92b71af239 Merge branch 'master' into 339-partage-d'export-enregistré
# Conflicts:
#	phpstan-baseline-level-4.neon
2025-06-17 09:50:11 +02:00
a0db7cd7e6 Order social actions according to startdate in desc order 2025-06-16 16:27:59 +02:00
011b6a29e4 Remove ux-translator which ended up back into package.json 2025-06-10 11:15:01 +02:00
527dc971d7 Order social actions according to startdate in desc order 2025-06-10 10:23:50 +02:00
43e5bc8337 Merge remote-tracking branch 'origin/339-partage-d'export-enregistré' into testing-202505 2025-05-30 15:00:37 +02:00
845e582c44 Merge remote-tracking branch 'origin/359-fusion-accompanying-period-work' into testing-202505 2025-05-30 14:59:23 +02:00
f3e04bd2bf Merge remote-tracking branch 'origin/master' into testing-202505 2025-05-30 14:58:45 +02:00
96e95dd8f1 Assure checkbox current user is checked in saved export 2025-05-27 16:19:57 +02:00
c40e790425 Add handling and cleanup for expired export generations
Implemented a new cron job to identify and process expired export generations, dispatching messages for their removal. Added corresponding message handler, tests, and configuration updates to handle and orchestrate the deletion workflow.
2025-05-26 17:46:46 +02:00
3a016aa12a Add auto-generated export descriptions and helper service
Introduce `ExportDescriptionHelper` to dynamically generate default descriptions for exports based on current settings. Update controllers, templates, and test cases to support and display the new auto-generated descriptions. This also adds a warning in the UI to prompt users to adjust these descriptions as needed.
2025-05-26 16:44:50 +02:00
be448c650e Refactor SavedExport listing to support filtering.
Introduced filtering capabilities for SavedExport listings by title and description. Moved index functionality to a new `SavedExportIndexController` and updated the repository with the necessary filter logic. Adjusted the Twig template to render the new filter interface.
2025-05-26 14:16:09 +02:00
9f32b5ac48 Refactor BySocialIssueFilter to enhance normalization logic
Added ExportDataNormalizerTrait to streamline data normalization and denormalization processes. Updated constructor to inject dependencies for SocialIssueRepository and NormalizerInterface, improving modularity and maintainability. Adjusted form data normalization methods to utilize the new utilities.
2025-05-26 14:15:51 +02:00
e89f5e4713 Add and enforce 'DUPLICATE' permissions for Saved Exports
Introduce a new 'DUPLICATE' permission in SavedExportVoter and update related logic in the controller and templates to enforce this rule. Ensure only authorized users can duplicate exports and adjust UI elements accordingly for better permission handling.
2025-05-26 12:26:48 +02:00
e79d6d670b Fix CS 2025-05-26 10:35:36 +02:00
9adbde0308 Add export configuration comparison and update options logic
Introduced a method to compare export generation options with saved exports, enabling detection of configuration differences. Updated template logic to conditionally adjust UI elements based on configuration discrepancies. This enhances flexibility when managing saved export options.
2025-05-26 10:35:27 +02:00
fe31cfd544 Refactor export generation to handle saved exports conditionally
Simplified the creation of `ExportGeneration` by introducing a `match` expression to handle cases with and without `savedExport`. This improves readability and ensures consistent handling of saved exports while normalizing configuration options.
2025-05-26 10:28:55 +02:00
e8bca6a502 Do not sync user which are enabled with UserGroup related to UserJob.
Updated SQL queries to include checks for user.enabled status, ensuring proper handling of both enabled and null states. This improves the synchronization logic by aligning it with user activity and account status conditions.
2025-05-23 15:52:11 +02:00
b0918ddd09 Php cs fixes 2025-05-21 09:59:01 +02:00
a368e68abb Merge branch 'testing-202505' of https://gitlab.com/Chill-Projet/chill-bundles into testing-202505 2025-05-21 09:40:32 +02:00
85b9784eef Fix pipeline 2025-05-21 09:40:13 +02:00
26fd16ab07 Transfer evaluations (and related documents) during merge 2025-05-20 16:44:42 +02:00
9a3fef862e Add missing translation accompanying period work duplicate controller 2025-05-20 14:05:02 +02:00
2c01516f71 add changie 2025-05-20 14:00:34 +02:00
246546b313 Retrieve schema to form full tablename and construct sql statements correctly in thirdparty merge service 2025-05-20 12:39:27 +02:00
bfe658d4fd Add pagination to works by period list api endpoint and use fetchResult in frontend 2025-05-08 16:03:52 +02:00
7ea6638c3a remove ux-translator from package.json 2025-04-28 10:51:33 +02:00
b04f0a9aa4 Merge branch '339-partage-d'export-enregistré' into testing-202505 2025-04-25 21:08:38 +02:00
ebdfa04843 Refactor user handling in filters for consistency
Updated `UserWorkingOnCourseFilter` and `ReferrerFilter` to ensure consistent handling of users via `userOrMe` methods. Also adjusted normalization/denormalization to align with these changes, enhancing readability and maintainability.
2025-04-25 21:04:30 +02:00
be213d5b5c Remove unused @symfony/ux-translator dependency
The @symfony/ux-translator package reference was removed from package.json because it is no longer required. This cleanup helps maintain a leaner and more focused dependency list.
2025-04-25 18:54:29 +02:00
4d1032c115 Merge remote-tracking branch 'origin/355-fusion-thirdparty' into testing-202505 2025-04-25 18:31:36 +02:00
e43dfc9a20 Merge remote-tracking branch 'origin/359-fusion-accompanying-period-work' into testing-202505 2025-04-25 18:29:32 +02:00
b11684fb3b set defualt value 2025-04-25 18:26:56 +02:00
b8826c6c0f remove unused property 2025-04-25 18:26:22 +02:00
a996b05ead Fix CS 2025-04-25 18:25:29 +02:00
cfcecf1cdc Refactor export management and configure messenger queue
Refactored the export initialization process by implementing the `ExportManagerAwareInterface` for better consistency. Added configuration to enable handling export requests via the messenger queue for improved task prioritization and execution efficiency.
2025-04-25 18:24:37 +02:00
b6985e0e5f Refactor form data handling in export filters and aggregators
Improved normalization and denormalization of form data by introducing default values and null handling across various filters and aggregators. Added `ExportDataNormalizerTrait` and repository dependencies where necessary to streamline data processing. This ensures more robust data handling and better default value management.
2025-04-25 18:24:26 +02:00
6d76b94644 Refactor title translation logic in SpreadSheetFormatter.
Simplified and streamlined the handling of title translation. Added truncation for titles exceeding 30 characters to ensure proper formatting. This enhances code readability and ensures title length consistency.
2025-04-25 18:23:58 +02:00
ff6ec45575 Add center filtering logic to export generation
Introduced a `filterStatsByCenters` configuration in `ExportGenerator` to enable conditional center filtering during exports. Updated related methods and tests to account for this parameter, ensuring compatibility with both filtered and unfiltered scenarios.
2025-04-25 18:23:37 +02:00
f3fd18e6fb Update export cancel button to redirect to saved exports
Changed the cancel button link in the export generation page to point to the saved exports list. This improves user navigation by directing them to their saved exports instead of the export index page.
2025-04-25 18:23:08 +02:00
c8851a8e8a Handle empty array case in denormalizeDoctrineEntity method
Previously, the method did not explicitly handle empty arrays, which could lead to unexpected behavior. This update ensures that when an empty array is provided as an ID, an empty array is returned immediately.
2025-04-25 17:28:57 +02:00
abdfe49c33 Fix fixedDate logic to handle empty string check
Previously, the `fixedDate` logic did not account for empty strings, which could lead to unexpected behavior. This change ensures that `fixedDate` is validated for both null and empty string values before processing.
2025-04-25 14:38:32 +02:00
e933f3e781 Restrict user fields in UserGroupType based on user jobs.
Refactored the form to conditionally add 'users' and 'adminUsers' fields only if the UserGroup does not have associated user jobs. This ensures data consistency and adjusts the form behavior dynamically based on the entity state.
2025-04-25 13:10:44 +02:00
fb1c34f9c1 Add UserGroup and UserJob synchronization feature
Implement UserGroupRelatedToUserJobSync to manage associations between UserGroups and UserJobs, including creating, updating, and removing relationships. Introduce a cron job to automate the synchronization process and add tests to ensure functionality. Update translations and repository logic as part of the implementation.
2025-04-25 13:07:52 +02:00
d506409d93 Refactor docblocks in UserJob repository interfaces.
Removed redundant PHP docblocks for array return types, as the return type hints already provide sufficient clarity. Added a @template annotation to specify the UserJob entity for the ObjectRepository.
2025-04-25 13:07:41 +02:00
9be8a533ff Add relation between UserGroup and UserJob
Introduce a ManyToOne relationship between UserGroup and UserJob entities to allow synchronization of group members with corresponding UserJobs. This includes a schema migration to add the `userJob_id` column, associated constraints, and an index, as well as updates to the UserGroup entity with new methods for managing the relationship.
2025-04-25 11:44:36 +02:00
b414b27ba9 Make methods private in ExportDataNormalizerTrait
Changed the visibility of several methods from public to private to improve encapsulation and restrict access to internal logic. This enhances code maintainability and prevents unintended use outside the intended scope.
2025-04-25 11:31:31 +02:00
8521672660 Make Security dependency readonly in SavedExportType
Marking the Security property as readonly ensures it cannot be reassigned after initialization. This enforces immutability, improving code safety and clarity.
2025-04-25 11:29:19 +02:00
3f5ce5f841 Refactor filters to support "me" as a user option.
Replaced `PickUserDynamicType` with `PickUserOrMeDynamicType` across filters to enable handling of the "me" option. Introduced normalization and denormalization methods for "me" and adjusted all relevant queries and test cases to accommodate this enhancement.
2025-04-25 11:24:33 +02:00
e1404bf16d Fix test with new signature of FormatterInterface 2025-04-24 22:16:40 +02:00
65b7ed0755 Fix Cs (and problably signature of FormatterInterface) 2025-04-24 22:00:46 +02:00
a74118e5d4 Add context parameter to export generation methods 2025-04-24 22:00:13 +02:00
828739edf5 use context where FormatterInterface is in use 2025-04-24 21:58:18 +02:00
d0811c8118 change FilterInterface::describeAction signature to remove the $format parameter 2025-04-24 21:49:26 +02:00
176bff0551 change FilterInterface::describeAction signature to include context 2025-04-24 21:48:00 +02:00
66c089e862 Refactor title translation logic in SavedExportController
Simplified and centralized title translation by introducing a check for TranslatableInterface. This ensures consistent handling of translatable titles and improves code readability.
2025-04-24 15:44:02 +02:00
aa44577484 Merge branch 'master' into 339-partage-d'export-enregistré
# Conflicts:
#	src/Bundle/ChillMainBundle/Resources/views/Dev/dev.assets.html.twig
2025-04-24 14:26:06 +02:00
8c59cbc6a0 Merge remote-tracking branch 'origin/366-pick-user-or-me' into 339-partage-d'export-enregistré 2025-04-24 14:24:48 +02:00
8c5a7ac3e1 Restrict export filters and aggregators for limited users
Added restrictions on export filters and aggregators based on user permissions. Introduced `ExportConfigProcessor` to handle allowed configurations and updated form components to respect these restrictions. Enhanced validation to enforce access control for unauthorized filter editing.
2025-04-24 14:21:51 +02:00
a6e523ee0a Fix string formatting style in SavedExportController
Replaced double quotes with single quotes for consistency in exception messages and translatable strings. This change improves code readability and maintains uniformity across the file.
2025-04-24 14:21:35 +02:00
d49058805a Refactor aggregator and filter retrieval into a new class
Moved aggregator and filter retrieval logic from ExportGenerator to the newly introduced ExportConfigProcessor class. This improves separation of concerns, simplifies ExportGenerator, and enhances code maintainability and readability. Updated related tests accordingly.
2025-04-24 14:21:16 +02:00
73496e0e1f Add documentation for trait ExportDataNormalizerTrait 2025-04-23 09:46:11 +02:00
973450110b Add duplicate and update options for saved exports
Introduce functionality to duplicate saved exports and update options directly from export generations. Update translations, controllers, views, and entities to support the new features, providing better flexibility and user experience around saved export management.
2025-04-23 09:11:50 +02:00
0f6b10aa0a Refactor SavedExport permissions and voter logic
Revised SavedExportVoter to improve consistency and streamline permission checks. Updated tests, controller logic, and templates to align with new voter structure and attributes. Fixed typos in permission constants and added checks for delete/edit actions in the UI.
2025-04-18 14:09:13 +02:00
edeb8edbea Add role-based access controls for export functionality
Introduced `CHILL_MAIN_COMPOSE_EXPORT` and `CHILL_MAIN_GENERATE_SAVED_EXPORT` roles for managing export creation and execution permissions. Updated access checks, menu routing, and templates to align with the new roles. Added a migration to extend existing permission groups with the `CHILL_MAIN_COMPOSE_EXPORT` role.
2025-04-17 17:34:09 +02:00
fc8e3789e0 Refactor SavedExportVoter to improve export permission check
Revised the permission logic in `canUserGenerate` to enhance clarity and maintainability. Replaced nested condition with early return and updated the export permission check to use `isGrantedForElement`.
2025-04-17 15:47:38 +02:00
52a80f9621 Add flash message for successful ACPW merge
This update informs users when accompanying period works are successfully merged by adding a success flash message. A new translatable message was also added for proper localization of this notification.
2025-04-15 14:54:15 +02:00
5632697c05 Fixes 2025-04-15 14:46:00 +02:00
75932b0e29 Fixes 2025-04-15 14:08:39 +02:00
7e2bf91e09 Fixes 2025-04-15 14:02:25 +02:00
0581b59dbd Merge remote-tracking branch 'refs/remotes/origin/master' into 359-fusion-accompanying-period-work 2025-04-14 15:53:55 +02:00
4661ba9932 Fix translation key casing for 'First name' label
Updated the translation key from 'firstName' to 'First name' in the details view template to ensure consistency with the expected translation format. This improves clarity and alignment with other labels.
2025-04-14 15:51:44 +02:00
f85b0c8cf7 Add flash message for successful third-party merge
This commit introduces a flash message to inform users when a third-party merge is successful. It uses Symfony's `FlashBag` and `TranslatableMessage` for better user feedback and localization support.
2025-04-14 15:51:43 +02:00
e701e96187 Fix merging: update the thirdparty related column and not the other one 2025-04-14 15:49:51 +02:00
d9d151aa89 Merge branch 'refs/heads/master' into 355-fusion-thirdparty 2025-04-14 11:29:46 +02:00
a14ed78e25 [wip] temporary changie 2025-04-14 11:01:03 +02:00
420dd4f868 Add SHARE permission to SavedExportVoter with tests
Introduced the SHARE attribute and updated SavedExportVoter to handle it. Added new functionality to check if a SavedExport is shared with a specific user and included corresponding unit tests for both the voter and entity behaviors.
2025-04-14 10:59:47 +02:00
3d9b9ea672 Layout of saved export page 2025-04-14 10:59:31 +02:00
9f12b42961 saved export: add form to share the export 2025-04-14 10:59:09 +02:00
2842548c17 Layout for export list 2025-04-14 10:58:52 +02:00
35f5501489 Add sharing functionality for SavedExport with users/groups
Introduced support for sharing SavedExport entities with individual users or groups. Added new collections, methods for adding/removing/viewing shares, and a migration to create relevant join tables in the database. This enhances collaboration by enabling flexible access control.
2025-04-14 10:58:13 +02:00
5e2d960a19 Fix comparison in new GenerateButton 2025-04-11 09:34:21 +02:00
4129283a58 fix tests 2025-04-08 17:41:34 +02:00
f807d62dab Merge branch 'refs/heads/master' into 339-partage-d'export-enregistré 2025-04-08 17:30:38 +02:00
5a7bba83f7 Ignore PHPStan warning for deprecated method usage
Added a PHPStan ignore comment to bypass warnings for calling a deprecated method, which remains necessary for compatibility. This ensures functionality while avoiding static analysis issues.
2025-04-08 17:30:08 +02:00
50c75dff1a Refactor export method to use FormattedExportGeneration.
Replaces direct BinaryFileResponse usage with FormattedExportGeneration for handling file exports. Removes unnecessary imports and ensures temporary file cleanup after processing.
2025-04-08 17:29:10 +02:00
e37f3e7c37 Refactor GenderFilter to enhance data normalization.
Introduced logic to map and transform gender data for normalization and denormalization, aligning with expected formats. Updated associated tests to cover new scenarios and ensure consistent behavior.
2025-04-08 17:24:38 +02:00
b6375cad6c fix tests 2025-04-08 16:32:56 +02:00
8516c87a14 fix tests 2025-04-08 15:50:03 +02:00
8c5abbff74 Update type handling in entity normalization methods
Extended support for `string` types in `normalizeDoctrineEntity` and `denormalizeDoctrineEntity` methods. This ensures compatibility with a broader range of identifier formats and improves flexibility in entity processing.
2025-04-08 15:49:55 +02:00
e0f94ae900 Handle null input in fromNormalized method
Updated the `fromNormalized` method to return null when provided with a null input. This ensures better handling of edge cases and prevents potential errors from null data.
2025-04-08 15:49:04 +02:00
f683e45b6e Fix tests 2025-04-08 15:42:03 +02:00
b1b7fb6401 Fix tests 2025-04-08 15:40:33 +02:00
8fa06e143d Fix tests 2025-04-08 15:37:27 +02:00
ec3d901d2f Fix tests 2025-04-08 15:30:25 +02:00
f12d689382 Fix tests 2025-04-08 15:24:52 +02:00
1c04219859 Add RegroupmentRepository dependency to ExportConfigNormalizer
This change introduces the RegroupmentRepositoryInterface as a new dependency in the ExportConfigNormalizer. It updates related test cases to mock and pass the new repository, ensuring proper coverage and functionality.
2025-04-08 15:24:40 +02:00
2b88593e64 Add RegroupmentRepositoryInterface and integrate it
Created a new `RegroupmentRepositoryInterface` to define repository methods for Regroupment entities. Updated `RegroupmentRepository` to implement this interface, and replaced its usage in `ExportConfigNormalizer` for better abstraction and testability.
2025-04-08 15:24:18 +02:00
ee65c46d2a Add handling for iterable values in test assertions
This update ensures that iterable values are properly handled in test assertions by skipping over them when needed. The change was applied consistently across AbstractAggregatorTest, AbstractFilterTest, and AbstractExportTest to improve test robustness.
2025-04-08 14:57:37 +02:00
7c239eaf6a Refactor entity check logic in test assertions.
Replaced the usage of `$em->contains` with a more generic `is_object` and `method_exists` check for `getId`. This improves test flexibility and removes reliance on the EntityManager in these cases.
2025-04-08 14:42:40 +02:00
694b1f3c1f Add data normalization test and context handling improvements
Introduced data normalization testing methods to validate form data processing. Enhanced `initiateQuery` to include `ExportGenerationContext` with user retrieval logic for improved query handling. These changes strengthen data integrity and contextual query execution within export functionality.
2025-04-08 14:42:34 +02:00
80b9ce3c3e Refactor tests to include ExportGenerationContext and data normalization
Added ExportGenerationContext usage in aggregator and filter tests to provide user context during query alterations. Introduced new data normalization tests and related logic, ensuring consistency and validation for normalized and denormalized forms. Refactored `getUser` methods for better scoping and reusability.
2025-04-08 14:26:19 +02:00
3f218e7183 Add data provider and test for form data normalization
Introduced a `dataProviderFormDataToNormalize` method to supply test cases for normalization. Added `testDataNormalization` to validate form data normalization and ensure consistency between normalized and denormalized data.
2025-04-08 14:09:26 +02:00
a2713041da fix cs 2025-04-08 14:09:16 +02:00
3a904e8ea1 Fix method return type from closure to callable
Updated the return type of the `getLabels` method to `callable` for better type accuracy. This aligns with PHP standards and improves code clarity and maintainability.
2025-04-08 13:40:11 +02:00
6f1a26742d Refactor method signatures for stricter type safety
Updated method parameters to enforce stricter type declarations, improving code clarity and reducing potential runtime errors. This change ensures better consistency across interfaces and aligns with modern PHP typing practices.
2025-04-08 13:40:05 +02:00
0d0a626f50 Implements return types on aggregators 2025-04-08 12:38:52 +02:00
ec5f4ed1d6 Refactor type annotations in export interfaces
Updated return type annotations in `AggregatorInterface` for clarity and adjusted generics in `ListInterface` to better reflect supported query types. This improves code readability and strengthens type safety.
2025-04-08 12:38:38 +02:00
d9251239f7 Remove unused CSVFormatter and improve translations handling
CSVFormatter was deprecated and is no longer in use, so it was removed. Additionally, translation handling was enhanced across multiple formatters, supporting `TranslatableInterface` to ensure better localization compatibility.
2025-04-08 10:38:07 +02:00
b2d3d806b6 Fix PHPDocs and return type declarations in export interfaces
Corrected typos in PHPDocs, added missing type templates, and ensured proper return type declarations. These changes improve code readability, consistency, and type safety across export-related interfaces.
2025-04-08 10:37:47 +02:00
8e952cc966 Implements new return types 2025-04-07 14:35:29 +02:00
1c4ee37507 Refactor entity normalization to handle Doctrine Collection.
Updated `normalizeDoctrineEntity` to support normalizing `Collection` objects and handle null values in arrays. This ensures compatibility with a broader range of entity structures and improves data integrity during normalization.
2025-04-07 14:35:07 +02:00
8331a836f2 Add explicit return types and TranslatableInterface support
Updated interfaces to include explicit return types for improved type safety and readability. Integrated support for Symfony's TranslatableInterface in relevant methods to enhance translation handling.
2025-04-07 14:26:11 +02:00
2482dcc62e Refactor ExportManager integration and remove ExportsCompilerPass
Replaced direct ExportManager dependencies in formatters with an ExportManagerAwareTrait to decouple components and enhance flexibility. Removed the ExportsCompilerPass as it is no longer required, and adjusted service configurations to improve reliability and consistency.
2025-04-07 12:42:28 +02:00
f9a55a1bfd Fix debug artifact in ExportFormHelper
Removed unnecessary `dump()` calls when resolving centers and regroupments. This ensures cleaner processing and
2025-04-07 12:37:29 +02:00
15aa565caf Add custom exception classes for export errors
Introduced `ExportRuntimeException` and `ExportLogicException` to better categorize exceptions in the export process. Updated `ExportGenerationException` to extend `ExportRuntimeException` for clearer hierarchy and improved maintainability.
2025-04-07 11:38:42 +02:00
566b72ec9e Add $context parameter to export query generation
This update introduces the $context parameter to the query generator method. It ensures additional contextual data can be passed and utilized, improving the flexibility of export generation logic.
2025-04-07 11:31:52 +02:00
bb42ee25ff Update initiateQuery method to include ExportGenerationContext
The `initiateQuery` method now consistently incorporates the `ExportGenerationContext` parameter across various export classes, improving functionality and standardization. This change ensures compatibility and alignment with the expected method signature.
2025-04-07 11:29:04 +02:00
aebeca1d7a Use readonly properties in constructors for better immutability.
Converted constructor properties to readonly where applicable, ensuring immutability and promoting safer code practices. Updated throwable class reference for clarity and consistency.
2025-04-05 00:56:54 +02:00
1955249a60 Fix type handling in JSON decode for migration script
Ensure `json_decode` explicitly casts database values to strings to avoid type errors during migration. This prevents potential issues when processing `options` fields that may not already be of string type.
2025-04-05 00:53:01 +02:00
3b0a4e9c73 Refactor exports to include ExportGenerationContext.
Updated initiateQuery methods to pass ExportGenerationContext, enabling better user-specific query filtering. Removed redundant user retrieval in FilterListAccompanyingPeriodHelper, now relying on context-provided user data.
2025-04-05 00:35:42 +02:00
b5fd9cf4af Add SavedExportOptionsMigrator for migrating export options
Introduced SavedExportOptionsMigrator to handle the migration of saved export options with structures ensuring versioning. Added unit tests to validate transformation logic and edge cases for better reliability.
2025-04-05 00:35:16 +02:00
bb30ddc876 Add logging and validation to export generation handler
Introduce a logger to track processing steps, durations, and outcomes in `ExportRequestGenerationMessageHandler`. Add validation to prevent reprocessing of already generated export objects, ensuring robust error handling and improved traceability.
2025-04-05 00:08:37 +02:00
5ebb53173e Fix PHPStan comment format in ExportGenerator.php
Updated the PHPStan ignore comment to use a single asterisk for consistency with comment style. This change does not affect functionality but improves code readability and adherence to coding standards.
2025-04-05 00:08:21 +02:00
d1d6a00ebf Add failure handling for export generation errors
Introduce `OnExportGenerationFails` subscriber to handle export generation failures. It logs errors, updates the export status to failure, and records generation errors. Added tests to validate the new functionality.
2025-04-05 00:07:08 +02:00
e48bec490c Compute allowed centers and regroupment at the time of generating the export 2025-04-03 17:47:46 +02:00
128d365a72 Convert Rolling date using the clock instead of the built-in pivot date 2025-04-03 17:47:08 +02:00
10f66afdcd Update date formatting and add null-safe checks for pivot dates
Revised the date normalization format to align with ISO standards and ensure consistency. Additionally, introduced null-safe checks for pivot dates to avoid potential errors when these values are unset. Updated related tests to reflect these changes.
2025-04-02 11:35:47 +02:00
89aed74355 Refactor RollingDateConverter to use ClockInterface
Introduced ClockInterface for better time mocking and handling, replacing default instantiation with dependency injection. Adjusted RollingDate logic to accept nullable pivot dates and updated related tests for improved flexibility and accuracy.
2025-04-02 11:08:01 +02:00
b3bf405c5b Fix merge service and test 2025-04-01 16:15:34 +02:00
9124fa68e8 Refactor flash message handling to use translatable messages
Replaced raw translations with Symfony's TranslatableMessage for flash messages in the controller. Updated Twig templates to use the `|trans` filter for consistency in rendering translations. This ensures better handling of multilingual content across the application.
2025-04-01 14:47:39 +02:00
68b61b7d8a Refactor export-related controllers and helpers
Removed unused dependencies, obsolete methods, and redundant parameters across ExportController, ExportFormHelper, and SavedExportController. Simplified session handling and aligned method signatures to improve maintainability and code readability.
2025-04-01 14:19:15 +02:00
80d8f967fa Moved export listing functionality from ExportController to a new ExportIndexController
for improved separation of concerns. Updated tests accordingly to reflect the new controller structure.
2025-04-01 13:20:48 +02:00
1375a41de2 Refactor export handling to support ExportGeneration and SavedExport
Unified handling of ExportGeneration and SavedExport entities by introducing the SavedExportOrExportGenerationRepository. Simplified form data conversion using ExportConfigNormalizer, removing redundant FormBuilder logic. Adjusted dependent methods and controllers to accommodate these changes.
2025-04-01 10:38:51 +02:00
4fa4d3b65c Phpstan and cs fixes 2025-03-27 14:32:06 +01:00
bd4c34cc1d Fix eslint issues and add ts interfaces for typing 2025-03-27 14:26:43 +01:00
4cea678e93 Fix updating of manyToMany relationships 2025-03-27 13:34:16 +01:00
5e6833975b Fix handling comments and workflows on acpw 2025-03-26 20:25:54 +01:00
f523b9adb3 Fix typing errors 2025-03-26 20:25:39 +01:00
a211549432 Adjust template and add translations 2025-03-26 15:16:27 +01:00
17b1363113 Fixes after rebase + apply item styling for accompanying course work 2025-03-26 14:08:45 +01:00
3356ed8e57 Correct for loop to display accompanying period list items 2025-03-24 16:13:56 +01:00
2a7fa517ee Only show merge button if there are more than 1 works attached to the parcours 2025-03-24 16:07:47 +01:00
95972399a1 Remove redundant lines in test 2025-03-24 15:28:58 +01:00
85781c8e14 Use item renderbox for display of accompanyingperiodwork 2025-03-19 11:04:01 +01:00
00eb435896 Add chevron icon in merge button 2025-03-19 11:04:01 +01:00
ed71cffd6a Change behavior of information exchange between backend and frontend 2025-03-19 11:03:59 +01:00
ae679e6997 Fix merge service and passing of json to vue 2025-03-19 11:03:53 +01:00
e1d308fd97 WIP create new picker for accompanying period works 2025-03-19 11:03:42 +01:00
d9acda67e3 WIP dynamic picking of accompanying period work 2025-03-19 11:03:42 +01:00
e88da74882 WIP fusion accompanyingperiodwork: controller, form, templates 2025-03-19 11:03:41 +01:00
591c44d1a0 Create types 2025-03-19 11:03:18 +01:00
bf04b7981c Improve merge service according to specifications 2025-03-19 11:03:02 +01:00
df33eec30f WIP merge service 2025-03-19 11:03:00 +01:00
c657c98918 Styling and organization of components 2025-03-19 11:02:55 +01:00
ef5eb5b907 Open modal to select acpw 2025-03-19 11:02:27 +01:00
d683fe002d Different approach to creating acpw selector 2025-03-19 11:02:25 +01:00
555bbca59b WIP create new picker for accompanying period works 2025-03-19 11:02:22 +01:00
e9e9d5c458 WIP dynamic picking of accompanying period work 2025-03-19 11:02:22 +01:00
b1842a33ae WIP fusion accompanyingperiodwork: controller, form, templates 2025-03-19 11:02:19 +01:00
6afeaccf24 Improve merge service according to specifications 2025-03-19 11:01:52 +01:00
fb76bac480 WIP merge service 2025-03-19 11:01:49 +01:00
6ded185289 Treat duplicate in backend and setup confirm page of merge 2025-03-19 11:00:40 +01:00
95adc29f9d WIP create new picker for accompanying period works 2025-03-19 11:00:40 +01:00
4d0c3e683f WIP dynamic picking of accompanying period work 2025-03-19 11:00:40 +01:00
018aafc773 WIP fusion accompanyingperiodwork: controller, form, templates 2025-03-19 11:00:40 +01:00
c4aea4efc2 Create types 2025-03-19 11:00:40 +01:00
225e3ca13f Improve merge service according to specifications 2025-03-19 11:00:40 +01:00
8c1fa7956a WIP merge service 2025-03-19 11:00:40 +01:00
e253d1b276 Styling and organization of components 2025-03-19 11:00:40 +01:00
a52aac2d98 Update package.json 2025-03-19 11:00:40 +01:00
9e8cf60dd8 Open modal to select acpw 2025-03-19 11:00:40 +01:00
7682d81d50 Different approach to creating acpw selector 2025-03-19 11:00:40 +01:00
5d31ce96c1 WIP create new picker for accompanying period works 2025-03-19 11:00:40 +01:00
81ef64a246 WIP dynamic picking of accompanying period work 2025-03-19 11:00:40 +01:00
49d1f78001 WIP fusion accompanyingperiodwork: controller, form, templates 2025-03-19 11:00:40 +01:00
0d0f3528e2 Add (temporary) types in Main and ThirdpartyBundle 2025-03-19 11:00:40 +01:00
d97d5e689a Create types 2025-03-19 11:00:40 +01:00
95d80ce13e Improve merge service according to specifications 2025-03-19 11:00:40 +01:00
668720984d WIP merge service 2025-03-19 11:00:40 +01:00
245c3fa121 First commit - changie for feature 2025-03-19 11:00:40 +01:00
1af3e4c7ec Eslint fixes and phpcs fixer 2025-03-18 14:39:19 +01:00
5d0fc7a189 remove comment 2025-03-18 14:25:59 +01:00
483d50e776 Return a string 'me' in EntityToJsonTransformer.php 2025-03-18 14:25:59 +01:00
b4c6ccf309 Add missing rendering condition 2025-03-18 14:25:59 +01:00
ac6a81cbd8 Adjust styling of current user selected 2025-03-18 14:25:59 +01:00
9503cb89b6 Setup if condition in EntityToJsonTransformer.php for when 'me' is passed 2025-03-18 14:25:59 +01:00
b130dbdcdc Add translations for current user in pick entity component 2025-03-18 14:25:59 +01:00
b2b1865837 WIP backend userOrMePicker 2025-03-18 14:25:59 +01:00
ec5c4d51b3 Frontend: display and behavior of pickUserOrMe form field 2025-03-18 14:25:56 +01:00
180437f637 Add generation button for saved exports and improve UI flow
Introduce a Vue.js component to handle the generation of saved exports directly via a new button. Adjust related API endpoints, improve status handling, and remove redundant backend logic. Minor UI enhancements and translation updates included.
2025-03-17 14:25:57 +01:00
0c2508d26d Refactor ExportGeneration to improve serialization and usage
Streamlined the `ExportGeneration` entity by adding a `getStatus` accessor and updating the serialization group. Refactored frontend logic to use computed properties for `status` and `storedObject`. Simplified API methods to work with the updated `ExportGeneration` interface for consistent handling.
2025-03-17 10:41:54 +01:00
b2d8d21f04 Add export generation creation from saved export endpoint
Introduce a new controller for creating export generations from saved exports using a POST endpoint. Updates include a new route, serialization groups, and a corresponding test to validate functionality.
2025-03-16 22:47:57 +01:00
6a2aa77ecc Add setter for SavedExport and update SavedExport logic
Introduced a `setSavedExport` method in `ExportGeneration` entity to enable better association handling. Updated `SavedExportController` to use this setter and adjusted template reference for the 'new' action. Removed unused `TranslatableStringHelperInterface` dependency for cleaner code.
2025-03-14 17:26:40 +01:00
e7cd9e00f9 Add functionality to save exports from export generations
Introduced a new route and controller method to create saved exports directly from an export generation. Updated the Twig template to include a "Save" button, enabling users to utilize this new feature seamlessly. This enhances export management and provides a more convenient user experience.
2025-03-13 18:05:56 +01:00
39f60b5b34 Add association between ExportGeneration and SavedExport
This update introduces a relationship between ExportGeneration and SavedExport. It includes a new SavedExport field in the ExportGeneration entity and the corresponding database migration. These changes enable ExportGeneration to reference its originating SavedExport if applicable.
2025-03-13 18:05:34 +01:00
c9c29b9105 Add ExportGenerationVoter and integrate it into StoredObjectVoter
Introduced ExportGenerationVoter to handle specific view permissions for ExportGeneration entities. Updated ExportGenerationStoredObjectVoter to delegate permission checks to the new voter using Symfony's security system. This improves separation of concerns and reusability of authorization logic.
2025-03-13 17:53:10 +01:00
fb806a9579 Add title and creation date to export data handling
Enhanced export functionality by including `title` and `createdDate` in data passed to the Vue app. Updated controllers, templates, and components to handle and display the new fields, improving export file naming and user interface. Removed a debug `dump` call for cleaner code.
2025-03-13 17:36:47 +01:00
70ca4acafb Add voter for ExportGeneration stored object authorization
Introduces `ExportGenerationStoredObjectVoter` to handle permissions for stored objects linked to export generations. Implements entity association retrieval in `ExportGenerationRepository` by adhering to `AssociatedEntityToStoredObjectInterface`.
2025-03-13 17:23:05 +01:00
bd61eedfbb Migrate export generation flow from plain JS to Vue
Replaced the old JavaScript-based export generation logic with a Vue.js implementation to improve maintainability and modularity. Introduced a new API endpoint to fetch export status, updated the Webpack config, and integrated translations and Twig templates for the new flow. The Vue-based solution enhances user feedback and error handling during the export process.
2025-03-13 17:03:14 +01:00
80ce7f0bf1 Implement ExportGenerationController with waiting and status routes
Added a new controller to handle export generation wait views and status responses. Updated ExportController to redirect to the 'wait' route after export generation. Introduced tests to validate object status handling for pending and ready states.
2025-03-13 15:29:49 +01:00
1ebf838bde Refactor ExportRequestGenerationMessageHandler logic.
Enhance the message handler to properly manage stored objects by leveraging `StoredObjectManagerInterface` and `EntityManagerInterface`. Added logic for writing generated content, updating stored object status, and ensuring data persistence with a DB flush.
2025-03-13 14:19:00 +01:00
85a9c6bb67 Refactor export manager and normalize configuration handling
Simplified formatter and aggregator logic by removing redundant fields and improving method checks (e.g., `hasAggregator`, `hasFilter`). Adjusted test cases to align with the updated structure and added tests for empty data normalization and denormalization. Improved code readability and ensured better handling of edge cases in export data processing.
2025-03-13 14:18:54 +01:00
db073fc920 Refactor ExportController to handle async generation of exports 2025-03-13 14:18:23 +01:00
46ebfca28f add ExportNormalizerConfig service to DI configuration file 2025-03-12 22:15:43 +01:00
22a2605381 fix messenger config: remove AuthenticationMiddleware 2025-03-12 22:15:25 +01:00
4f6a7116a4 fixup! Add ChillBundle normalization methods rector rule 2025-03-12 21:57:54 +01:00
cac7d33a44 fixup! Add ChillBundle normalization methods rector rule 2025-03-12 21:51:24 +01:00
0609e3f4c3 fixup! Add Rector Rule to inject normalization methods into export classes 2025-03-12 21:50:33 +01:00
3a738179f2 use correct repository for filters and aggregators 2025-03-12 17:41:59 +01:00
a789bf5e1c Add return type for getTargets() method in validator
Ensure the `getTargets()` method specifies its return type for better code clarity and type safety. This update aligns with modern PHP practices and improves maintainability.
2025-03-12 17:41:28 +01:00
0a21fada42 fixup! Add normalization and denormalization for RollingDate 2025-03-12 10:04:12 +01:00
4f030eb11a Add date normalization and denormalization functionality
Introduce methods to normalize and denormalize DateTime objects using specific formats. Also, implement corresponding unit tests to ensure correct handling of single and multiple Doctrine entities, as well as date normalization.
2025-03-12 10:00:39 +01:00
0d2a487ae7 Add new normalization methods on filters, aggregators exports and formatter by applying rector rule 2025-03-11 22:28:42 +01:00
6cb23344fc Add ChillBundle normalization methods rector rule
This commit introduces a new rector rule to add normalization methods for ChillBundle exports. It removes an outdated rector configuration and ensures alignment with current standards.
2025-03-11 22:18:04 +01:00
da0d7a3b9e fixup! Add Rector Rule to inject normalization methods into export classes 2025-03-11 22:17:42 +01:00
fcc61aa4c0 fixup! Add Rector Rule to inject normalization methods into export classes 2025-03-11 16:21:16 +01:00
21ec96b75c fixup! Add Rector Rule to inject normalization methods into export classes 2025-03-11 15:31:30 +01:00
93f934152f !fixup fix rector rule 2025-03-11 15:28:28 +01:00
49f4cce72a fixup! Rename getVersion to getNormalizationVersion. 2025-03-11 15:09:26 +01:00
e69b679938 Add Rector Rule to inject normalization methods into export classes
This update introduces a Rector rule to automatically add `normalizeFormData`, `denormalizeFormData`, and `getNormalizationVersion` methods to export-related classes implementing specific interfaces. It ensures consistency and reduces manual work by leveraging traits and default implementations for normalizing form data. Test fixtures and configurations are included to validate and support this functionality.
2025-03-11 15:08:48 +01:00
229f9b7125 Rename getVersion to getNormalizationVersion.
This change improves clarity by making the method name more descriptive and aligned with its purpose. All relevant interfaces, classes, and tests have been updated accordingly to reflect this renaming.
2025-03-10 21:37:32 +01:00
4fc433cd63 Rename and implement form data normalization for filters
The `StepFilterTest` was renamed to `StepFilterOnDateTest` for improved clarity. Added `normalizeFormData` and `denormalizeFormData` methods to `UserJobFilter` and `StepFilterOnDate` for handling form data conversions. Also introduced `ExportDataNormalizerTrait` to enhance consistency in data normalization processes.
2025-03-10 21:17:25 +01:00
2c91d2e10f Add normalization and denormalization for RollingDate
Introduce methods to normalize and recreate RollingDate objects, ensuring consistent serialization and deserialization. Includes corresponding tests for both cases with and without a pivot date.
2025-03-10 21:07:54 +01:00
4302506471 Fix translation and cs-fixes 2025-03-05 19:43:16 +01:00
09b7558e92 Remove the transferData method from mergeService 2025-03-05 19:27:32 +01:00
6ba5c91ee6 redo test 2025-03-05 19:27:32 +01:00
535409e529 phpstan and php cs fixer 2025-03-05 19:27:32 +01:00
9979378e78 validate thirdparty merge 2025-03-05 19:27:32 +01:00
58291c7402 Add suggested thirdparties, with same parent, for thirdparties of kind 'child' 2025-03-05 19:27:32 +01:00
3d397c0145 Adjust templates and add translations 2025-03-05 19:27:32 +01:00
d84f3ee5ad Modify translations and if conditions in updateReference method 2025-03-05 19:27:32 +01:00
6db16e6d0b Add translations 2025-03-05 19:27:30 +01:00
ed60c6aaa3 Remove dumps and inject thirdparty directly into controller action 2025-03-05 19:27:11 +01:00
13b1d20ade Resolve manyToMany cases 2025-03-05 19:27:11 +01:00
5999c73c98 Refactor merge 2025-03-05 19:27:10 +01:00
580366de6d Continue thirdparty merge controller and create views 2025-03-05 19:27:03 +01:00
7f69f21b64 Renamen and reorganize thirdparty merge files 2025-03-05 19:26:50 +01:00
683a0bc4e9 Create thirdparty merge test 2025-03-05 19:26:06 +01:00
4d6d40629f Create thirdparty merge manager 2025-03-05 19:26:06 +01:00
2185791665 Use sql statements for transferData method and fix updateReferences method 2025-03-05 19:26:06 +01:00
bf14c92567 Continue thirdparty merge controller and create views 2025-03-05 19:26:04 +01:00
7c1c1ed800 Renamen and reorganize thirdparty merge files 2025-03-05 19:25:31 +01:00
3b3659f13f WIP Create thirdparty merge controller 2025-03-05 19:25:31 +01:00
ebfdc57fcf Create thirdparty merge test 2025-03-05 19:25:31 +01:00
a562690512 Create thirdparty merge manager 2025-03-05 19:25:31 +01:00
1751c65731 add missing arguments to method alterQuery (wip) 2025-02-24 16:49:15 +01:00
791f5bb4be Remove custom Messenger authentication logic (WIP)
Eliminated the `AuthenticationMiddleware`, `AuthenticatedMessengerToken`, and `AuthenticationStamp` classes, along with their service declarations. This cleanup removes unused or unnecessary code, simplifying the project and reducing maintenance overhead.
2025-02-24 16:13:20 +01:00
2c812fc5fe Generate export using denormalization 2025-02-23 23:16:30 +01:00
1f1d38acef infrastructure for normalizing form config [WIP] 2025-02-21 15:08:09 +01:00
057c34610d First step to async generation [WIP] 2025-02-20 14:33:50 +01:00
732b7dc8f7 Add missing return types
This will avoid deprecation messages
2025-02-19 21:40:39 +01:00
cb068cdee7 Add ExportGeneration entity and migration
Introduce the `ExportGeneration` entity for managing export generation data, including related properties such as `exportAlias`, `options`, and `deleteAt`. Add corresponding database migration to create the `chill_main_export_generation` table with necessary constraints and indices. Update `composer.json` to include the `symfony/uid` package.
2025-02-19 16:45:37 +01:00
647 changed files with 10270 additions and 20623 deletions

View File

@@ -0,0 +1,6 @@
kind: DX
body: Allow TranslatableMessage in flash messages
time: 2025-04-01T14:47:28.814268801+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,44 @@
kind: DX
body: |
Rewrite exports to run them asynchronously
changelog: |
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
```diff
# config/packages/messenger.yaml
framework:
messenger:
routing:
+ 'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority
```
time: 2025-04-07T12:10:10.682561327+02:00
custom:
Issue: ""
SchemaChange: Add columns or tables

View File

@@ -0,0 +1,6 @@
kind: DX
body: Remove dead code for wopi-link module
time: 2025-04-30T14:45:50.406111606+02:00
custom:
Issue: "352"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: DX
body: Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required)
time: 2025-05-28T16:58:13.226870341+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: DX
body: Use mkdocs instead of sphinx to build chill developer documentation
time: 2025-11-17T16:06:50.46185765+01:00
custom:
Issue: "386"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Feature
body: Allow the merge of two accompanying period works
time: 2025-02-11T14:22:43.134106669+01:00
custom:
Issue: "359"
SchemaChange: No schema change

View File

@@ -0,0 +1,7 @@
kind: Feature
body: Add the document file name to the document title when a user upload a document,
unless there is already a document title.
time: 2025-04-24T14:22:11.800975422+02:00
custom:
Issue: "377"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Feature
body: Add desactivation date for social action and issue csv export
time: 2025-05-20T09:56:28.108941934+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Feature
body: Add Emoji and Fullscreen feature to ckeditor configuration
time: 2025-05-23T13:33:41.645095128+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Feature
body: Create editor which allow us to toggle between rich and simple text editor
time: 2025-05-23T13:34:34.56795603+02:00
custom:
Issue: "321"
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: Feature
body: Make a calendar item on the 'mes rendez-vous' page clickable. Clicking will navigate to the edit page of the calendar item.
time: 2025-11-12T10:32:24.916576945+01:00
custom:
Issue: "461"
SchemaChange: No schema change

View File

@@ -0,0 +1,7 @@
kind: Fixed
body: trying to prevent bug of typeerror in doc-history + improved display of document
history
time: 2025-04-24T13:39:43.878468232+02:00
custom:
Issue: "376"
SchemaChange: No schema change

View File

@@ -0,0 +1,7 @@
kind: Fixed
body: Display previous participation in acc course work even if the person has left
the acc course
time: 2025-04-24T16:37:46.970203594+02:00
custom:
Issue: "381"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Fix display of text in calendar events
time: 2025-05-05T10:27:15.461493066+02:00
custom:
Issue: "372"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Add missing translation for user_group.no_user_groups
time: 2025-05-14T14:53:39.53927329+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Fix retrieve schema to form full tablename and construct sql statements correctly in Thirdparty merger.
time: 2025-05-20T14:00:08.987229634+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Fix add missing translation
time: 2025-05-20T14:04:33.612140549+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Fix the transfer of evaluations and documents during of accompanyingperiodwork
time: 2025-05-20T16:44:29.093304653+02:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: Fixed
body: Display calendar items for which an invite was accepted on the mes rendez-vous page
time: 2025-11-12T17:00:25.58946528+01:00
custom:
Issue: "463"
SchemaChange: No schema change

View File

@@ -1,7 +0,0 @@
kind: Fixed
body: |
Improve accessibility on login page
time: 2025-11-13T12:01:25.488478771+01:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: UX
body: Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
time: 2025-04-23T17:26:24.45777387+02:00
custom:
Issue: "374"
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: UX
body: Remove the label if there is only one scope and no scope picking field is displayed.
time: 2025-10-30T15:31:26.807444365+01:00
custom:
Issue: "449"
SchemaChange: No schema change

View File

@@ -1,22 +0,0 @@
## v3.12.0 - 2025-06-30
### Feature
* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title.
* Add desactivation date for social action and issue csv export
* Add Emoji and Fullscreen feature to ckeditor configuration
* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor
* Do not remove workflow which are automatically canceled after staling for more than 30 days
### Fixed
* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history
* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course
* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events
* Add missing translation for user_group.no_user_groups
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* ([#392](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/392)) Allow null and cast as string to setContent method for NewsItem
* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment.
### DX
* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module
* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required)
### UX
* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
* Improve labeling of fields in person resource creation form

View File

@@ -1,3 +0,0 @@
## v3.12.1 - 2025-06-30
### Fixed
* Fix loading of the list of documents

View File

@@ -1,74 +0,0 @@
## v4.0.0 - 2025-07-08
### Feature
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
### Fixed
* ([#390](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/390)) Display the list of participant in the results, even if there is only one participant and that the search result display the requestor
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* Fix translations for social action fields in admin form: results, goals, evaluations
### DX
* Rewrite exports to run them asynchronously
**Schema Change**: Add columns or tables
* Allow TranslatableMessage in flash messages
### UX
* Improve labeling of fields in person resource creation form
**Release notes**
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
```diff
# config/packages/messenger.yaml
framework:
messenger:
routing:
+ 'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority
```
- add missing methods to exports, aggregators, filters, formatter:
```php
public function normalizeFormData(array $formData): array;
public function denormalizeFormData(array $formData, int $fromVersion): array;
```
There are rector rules to generate those methods:
- `Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector`
See:
```php
// upgrade chill exports
$rectorConfig->rules([\Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector::class]);
```
This rule will create most of the work necessary, but some manuals changes are still necessary:
- we must set manually the correct repository for method `denormalizeDoctrineEntity`;
- when the form data contains some entities, and the form type is not one of EntityType::class, PickUserDynamicType::class, PickUserLocationType::class, PickThirdpartyDynamicType::class, Select2CountryType::class, then we must handle the normalization manually (using the `\Chill\MainBundle\Export\ExportDataNormalizerTrait`)

View File

@@ -1,4 +0,0 @@
## v4.0.1 - 2025-07-08
### Fixed
* Fix package.json for compilation

View File

@@ -1,4 +0,0 @@
## v4.0.2 - 2025-07-09
### Fixed
* Fix add missing translation
* Fix the transfer of evaluations and documents during of accompanyingperiodwork

View File

@@ -1,12 +0,0 @@
## v4.1.0 - 2025-08-26
### Feature
* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes
* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default
* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports
**Schema Change**: Add columns or tables
### Fixed
* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed.
* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType
### UX
* Limit display of participations in event list

View File

@@ -1,10 +0,0 @@
## v4.2.0 - 2025-09-02
### Feature
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
**Schema Change**: Add columns or tables
* ([#330](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/330) Allow users to choose for which notifications they want to receive an email
### Fixed
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
* Fix typo in 'uncheckAll' script for centers selection
* Fix incorrect parameter name in event details link

View File

@@ -1,6 +0,0 @@
## v4.2.1 - 2025-09-03
### Fixed
* Fix exports to work with DirectExportInterface
### DX
* Improve error message when a stored object cannot be written on local disk

View File

@@ -1,10 +0,0 @@
## v4.3.0 - 2025-09-08
### Feature
* ([#409](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/409)) Add 45 and 60 min calendar ranges
* Add a command to generate a list of permissions
* ([#412](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/412)) Add an absence end date
**Schema Change**: Add columns or tables
### Fixed
* fix date formatting in calendar range display
* Change route URL to avoid clash with person duplicate controller method

View File

@@ -1,8 +0,0 @@
## v4.4.0 - 2025-09-11
### Feature
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
* ([#369](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/369)) Duplication of a document to another accompanying period work evaluation
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Fusion of two accompanying period works
### Fixed
* Fix display of 'duplicate' and 'merge' buttons in CRUD templates
* Fix saving notification preferences in user's profile

View File

@@ -1,3 +0,0 @@
## v4.4.1 - 2025-09-11
### Fixed
* fix translations in duplicate evaluation document modal and realign close modal button

View File

@@ -1,3 +0,0 @@
## v4.4.2 - 2025-09-12
### Fixed
* Fix document generation and workflow generation do not work on accompanying period work documents

View File

@@ -1,13 +0,0 @@
## v4.5.0 - 2025-10-03
### Feature
* Only allow delete of attachment on workflows that are not final
* Move up signature buttons on index workflow page for easier access
* Filter out document from attachment list if it is the same as the workflow document
* Block edition on attached document on workflow, if the workflow is finalized or sent external
* Convert workflow's attached document to pdf while sending them external
* After a signature is canceled or rejected, going to a waiting page until the post-process routines apply a workflow transition
### Fixed
* ([#426](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/426)) Increased the number of required characters when setting a new password in Chill from 9 to 14 - GDPR compliance
* Fix permissions on storedObject which are subject by a workflow
### DX
* Introduce a WaitingScreen component to display a waiting screen

View File

@@ -1,4 +0,0 @@
## v4.5.1 - 2025-10-03
### Fixed
* Add missing javascript dependency
* Add exception handling for conversion of attachment on sending external, when documens are already in pdf

View File

@@ -1,14 +0,0 @@
## v4.6.0 - 2025-10-15
### Feature
* ([#423](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/423)) Create environment banner that can be activated and configured depending on the image deployed
* ([#394](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/394)) Only show active workflow on the page "my tracked workflow"
### Fixed
* Fix loading of classLists in SocialIssuesAcc.vue, ensure elements are present
* Fix the rendering of list of StoredObjectVersions, where there are kept version (before converting to pdf) and intermediate versions deleted
* ([#434](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/434)) Notification: fix editing of sent notification by removing form.addressesEmails, a field that no longer exists
* Fix loading of social issues and social actions within vue component
* ([#446](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/446)) Add unique condition on stored object filename, with cleaning step on existing duplicate filenames
**Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed
* [workflow] take permissions into account to delete the workflow attachment
* ([#448](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/448)) Fix the execution of daily cronjob notification, when the previous last execution storage was invalid

View File

@@ -1,3 +0,0 @@
## v4.6.1 - 2025-10-27
### Fixed
* Fix export case where no 'reason' is picked within the PersonHavingActivityBetweenDateFilter.php

View File

@@ -1,21 +0,0 @@
## v4.7.0 - 2025-11-10
### Feature
* ([#385](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/385)) Create invitation list in user menu
* ([#404](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/404)) Add columns for comments linked to an activity in the activity list export
### Fixed
* ([#451](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/451)) Fix: display also social actions linked to parents of the selected social issue
* ([#453](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/453)) Fix: export actions and their results in csv even when action does not have any goals attached to it.
* Fix the possibility to delete a workflow
**Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed
* ([#457](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/457)) Fix the fusion of thirdparty properties that are located in another schema than public for TO_ONE relations + add extra loop for MANY_TO_MANY relations where thirdparty is the source instead of the target
* ([#428](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/428)) Fix suggestion of referrer when creating notification for accompanyingPeriodWorkDocument
### DX
* Send notifications log to dedicated channel, if it exists
### UX
* ([#425](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/425)) Change the terms 'cercle' and 'centre' to 'service', and 'territoire' respectively.
* ([#542](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/542)) Improve the ux for selecting whether user wants to be notified of the final step of a workflow or all steps
* Expand timeSpent choices for evaluation document and translate them to user locale or fallback 'fr'
* ([#455](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/455)) Change the order of display for results and objectives in the social work/action form
* Wrap text when it is too long within badges

View File

@@ -7,6 +7,14 @@
"message": "'app' is assigned a value but never used.",
"hash": "f8c2979921289906e3baabae31ba101ead91504f"
},
{
"path": "src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js",
"line": 57,
"column": 23,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'event' is defined but never used.",
"hash": "cf0cf378f71403f62a6425f384ccbbdec433d1f2"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/module/Invite/answer.js",
"line": 7,
@@ -119,6 +127,46 @@
"message": "'payload' is defined but never used.",
"hash": "66c545917093ba30f1d6ca10ddaa676140e749bd"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"line": 224,
"column": 10,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reactive' is defined but never used.",
"hash": "96ed76a9828138fb125fc36c4b55e900bbfe87c2"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"line": 230,
"column": 5,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'DropArg' is defined but never used.",
"hash": "bd405399a4091d65e8391404bfb0c4611816c8e0"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"line": 251,
"column": 9,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'t' is assigned a value but never used.",
"hash": "bc09207a496405f7a71c178e522b89aeb1f7ebd3"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"line": 356,
"column": 32,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'arg' is defined but never used.",
"hash": "aeae152f0669b946a1ad681dd52b0ef03393ae79"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"line": 434,
"column": 11,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'changedEvent' is assigned a value but never used.",
"hash": "a7a81a6bf09d00c0364e3aa8207ffad853f0547b"
},
{
"path": "src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue",
"line": 77,
@@ -351,6 +399,14 @@
"message": "'error' is defined but never used.",
"hash": "e26e5e101e90d2b7ee84d6f5de8c819e52129c17"
},
{
"path": "src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/index.ts",
"line": 29,
"column": 14,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'vm' is defined but never used.",
"hash": "8e7f5e89dd72c54459cf82156389b88988f97d63"
},
{
"path": "src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js",
"line": 39,
@@ -559,6 +615,14 @@
"message": "'ref' is defined but never used.",
"hash": "2a27cd6d06a26e1326654c929068e3704137e24b"
},
{
"path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue",
"line": 57,
"column": 17,
"ruleId": "vue/valid-v-for",
"message": "Custom elements in iteration require 'v-bind:key' directives.",
"hash": "cce787939524e83dd135869e13738ef332d7156c"
},
{
"path": "src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue",
"line": 15,
@@ -919,6 +983,22 @@
"message": "'_e' is defined but never used.",
"hash": "1d6448401778e8c56554020fe5abd47851ed33f3"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js",
"line": 21,
"column": 55,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'e' is defined but never used.",
"hash": "eae499e4f6e9f43a9d17f9cd917cb6d3d97be25c"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/page/export/download-export.js",
"line": 3,
"column": 55,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'e' is defined but never used.",
"hash": "088fd383e7807e484aefc9825209bc7c8942bd22"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/page/homepage_widget/index.js",
"line": 9,
@@ -1009,19 +1089,115 @@
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 516,
"column": 21,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"context\" prop.",
"hash": "984c4203f2ac1e1bb65f9ce76ecd03b763cfaa83"
"line": 247,
"column": 5,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'postAddressToPerson' is defined but never used.",
"hash": "8a41c437cf2b5554cbbe1704cd51f3102b3d5994"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 517,
"line": 248,
"column": 5,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'postAddressToHousehold' is defined but never used.",
"hash": "66dec84b2ece299daf21308e5e60d497ba442b27"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 490,
"column": 21,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"context\" prop.",
"hash": "c9fb019bc21bfa77d989ed596913b99dd653c594"
"hash": "0d3f40c47974a4371072b3b9ee04b197c830162d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 491,
"column": 21,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"context\" prop.",
"hash": "8e877b7e588c30e182f7b572bdb9685360f9cf99"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 508,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "5a3e3401bc3c765d91faaf4cfde57697af1262b7"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 525,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "35a741d90379574b9323279f5802193d0c98a9dc"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 553,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "c23d1ddf6c0d10ae97948e74aee9c14b9320b86c"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 572,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "4322e81c6ea9d9734c680633a724d5bd4fabacb2"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 803,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "7928a6461b9d394c7d97f048933553936f7d8963"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"line": 852,
"column": 47,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "e5afdb8efccb5470a08dde48f755b1268fa947b5"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 93,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "68f5e1cf5c03f9ada59c9e0afca0b74c7f3fca4b"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 101,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "50d730f6109092baff2db66adc44dc1315e2bda2"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 109,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "573e4c041ce663f28b933d7a675c2a525aba644c"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 117,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "293f845eeab515b1df4649d136c2d8219ed59c4d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
@@ -1048,180 +1224,204 @@
"hash": "2d5a5e680ff207ad97c7e7b7d999064b561dfd8a"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 149,
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 106,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "e4c1ecd7ae77d46ac3625c5bbe92a24d6a964db9"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 157,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "4dece2db87c6ce1c04ae06c088ddfe916c1c0c61"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 165,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "facc7a0f17bdf19396fae3d0de3da82e60503c0d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"line": 173,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "19de32c76518387218264d7c4dab914d143a9cca"
"hash": "d52356f2af31d0167c02330ec22d09fbfa6b2b9f"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 130,
"line": 114,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "239ac02a02694d5b20ab30d4c7ce5838c51d1515"
"hash": "c8e8e06f370f93bf05867e93b5f037dfa46937b1"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 138,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "a54f9bc6d1edfa4df93c7dd7d409cfef3fccf99e"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 152,
"line": 128,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "74a5f664d18f3916ea908897fcd0291cb0128f29"
"hash": "9abaf71ca4b4f292b3b01e724d0a7733365e71f1"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 129,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "0b0743959778a9e3d93089b132608816ee4e6646"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 132,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "9759da7b7859b8ee8efaf74876430658ac6b6fe2"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 133,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "dba8be9a27ab74ec743b7d9e07c05d857b407dd3"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 134,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "9b1f5bce779aafc46b19d7a5d266eaa29f8f9be9"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 139,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "fe6fc4aea0994ba9da15b7c09d308842b67958cb"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 153,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "740ea5d793c7a34c9f352d8b333f3aa04cc80ee8"
"column": 55,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "bd0e024fcad2e3f4566f15293e3c25c840f6dd3e"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 156,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "af8aca18f0226a5988ed90d44d95e2d607bfb5e6"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 157,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "7bc2453017793ae20cd6c10005f941d384b59d84"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 158,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "571b4ee5f22358dd165ec59696bb3439b7c9ff6c"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 163,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "cfcb5946c86e289fc61623a794284a5a272d02e8"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 178,
"line": 154,
"column": 37,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "0ec402e43cb08bf129e0737c0d2c4f6d0c7af8bd"
"hash": "596c4b180b926b7829f987384328bf5636cd367a"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 196,
"line": 171,
"column": 59,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "5b41d5f9b45da074fb7bbbbd45e0da501da72071"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 172,
"column": 41,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "ec178d33e067aac892e015002afb6f3a2ff98762"
"hash": "d92b92a25043244cca809bd129633b7e024e26b4"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 214,
"line": 190,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "c0f4e5454e672b6064eb9cf6c235c6810f7bfa80"
"hash": "dd9a85ea740742d620e864796f67c5bff834486d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 215,
"line": 191,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "e3dd840d2474f9865a45822872bf9ecfb15961d7"
"hash": "e3e59960d0d50709a57b336f66b586710b774892"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 216,
"line": 192,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "a32a60382b145cc7a4a7ebe01ec435b8e3103320"
"hash": "fe11b0e54396511e7b3b08615a78d22fc27e2fad"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"line": 246,
"line": 222,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "082447e5c731012f3acc282943502775dfd24797"
"hash": "63c14c2150c33ec701bc4a0ff94efde69537d490"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 118,
"line": 96,
"column": 20,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "d4fba4fe09af3c0937c0dd164928c8930c1591b5"
"hash": "d2a9fdaeef0e2810f480022d4c6f99e4f76a818e"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 118,
"line": 96,
"column": 20,
"ruleId": "vue/no-side-effects-in-computed-properties",
"message": "Unexpected side effect in \"cities\" computed property.",
"hash": "1113a114d5aaf9f32f442916d25458541c5af35c"
"hash": "dd92a60a9b1ebefeb9a90941d45326fbfa483733"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 102,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "04be01ab638ce01f568fb0216929e65e1175ca23"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 110,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "8619c8e0b63e87d09268832f90e4fba06b87e41f"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 124,
"column": 17,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "fa56a7c93583f0a9d0c2ecac10228c4f4fc1bc3a"
"hash": "281f918da00635079501418b1e6b2c05b62eb4a7"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 132,
"column": 17,
"line": 125,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "9fe87937ea67d1dae95fb3d44d4be0da2eba0905"
"hash": "c131b09fa67ab1d069f1d04a54582d6b0f206153"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 126,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "3d3a2a4add64c291b8f5f1cddd90a173cd6a819d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 131,
"column": 21,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "ed48f4988914d7897018a2e06830a97e6740b3e8"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 145,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "744f3a7610d4d6015e50e25149bceffd6c6e2763"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
@@ -1241,139 +1441,115 @@
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 148,
"column": 13,
"line": 149,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "ab4f478fbfbc954b8dff75176dcd432f9ff28cfc"
"hash": "1e7b1ad55866f708baaca72dfa4ff26d6f8e5d21"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 153,
"column": 21,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "1d907d149f9ddb62e32140a90efe9a74b3e71fef"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 167,
"line": 152,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "8aa37d2d4f011773e68838a2c88017875de563b5"
"hash": "84779331536ffceec8d4a8c5ca4307310b882549"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 168,
"line": 161,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "a4827a357e52a51fa9262319114d81a130296acf"
"hash": "0789999841be671a4d8ab080d6fdb679f843eb52"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 169,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "a4c9715664202949e3242b8d4aa4098288b46dc4"
"line": 170,
"column": 51,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "bbb17afa114f016e2058d90aa32d2a625804f0d1"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 171,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "f3e9e21e433e90ec7b615b8940d43c4177372b66"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 174,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "770b7a24cc24b380e88db47d62422c8e1ece2571"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 183,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "2aef3c519a9ec6abcfe7573989d3de19d5c4c752"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 193,
"column": 33,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "5d1f97e4d7d9f47399d312e8b9f95ef9e3843b8c"
"hash": "5fbe407ceceb37bff2ac800ceddd7942540132f1"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 190,
"column": 55,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'reject' is defined but never used.",
"hash": "e2af91def877befbabef8e93deba4c58a3ee2ded"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 191,
"column": 37,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "ee8544ee45681a650ed7d4918ae979685cdd8f0f"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 210,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "5d9d2217c8c7e6571bc9f72a98ea5b370edb4968"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 211,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "6e04619b373c23c91f6c36c2aad314ac16cdb697"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 212,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "39df045639a62f64ccdb03a80e286bc3ad772587"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 213,
"column": 37,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "c1df874f790ef0c036bf58ae8a8db1ee173685d4"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 232,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "476e6588a28ac9382e8b9d2e63a8babecd23bad8"
"hash": "c399a43fa797a8ce61c9d96a644a39cc84a387b7"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 233,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "6a0c82ba72d6d87217bf33a6ad8e40a4b81bc802"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 234,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "741d5af6c7d90041c0dc1c1df2e8699b80fca69a"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 235,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "c3ffd141f58d532663875cc5c7d338ed00db2a6d"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"line": 267,
"line": 245,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "2700f258396516a2fe971618fafbcdf72cdda3ab"
"hash": "04337a07944caaa4819cfebcf29e1a7cbfdf248b"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue",
"line": 94,
"line": 76,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "4be1b0592efa775092a91a1d744e16ce98bd216e"
"hash": "373a2e31f110d138c66d77f1faf5dc61545c55af"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue",
"line": 99,
"line": 81,
"column": 13,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "19b54b6d76c30249d520a296f826eda9d6eb0668"
"hash": "421eb6a63224b4b1d81b216677a710c5c99ddee3"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue",
@@ -1393,19 +1569,19 @@
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue",
"line": 169,
"line": 155,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "dcb7b34098062760ddbb849655a5bb3ca65c36d3"
"hash": "b3a822914fcb5e2fcf28efc331a45b9205002eeb"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue",
"line": 178,
"line": 164,
"column": 17,
"ruleId": "vue/no-mutating-props",
"message": "Unexpected mutation of \"entity\" prop.",
"hash": "86b3ecf201025cac36878c5e4bf8850fb9d58cb5"
"hash": "72c7d850f6cdeaf65b373a33234222f9766ee30b"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js",
@@ -1455,6 +1631,14 @@
"message": "'app' is assigned a value but never used.",
"hash": "9e6125f4fc387dc362c69cc6e3ce360eb2851f1b"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue",
"line": 60,
"column": 22,
"ruleId": "vue/require-valid-default-prop",
"message": "Type of the default value for 'suggested' prop must be a function.",
"hash": "d30212820bc2e97fa02d75dbc3a014558693f169"
},
{
"path": "src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/Parts/AddressDetailsMap.vue",
"line": 24,
@@ -1543,6 +1727,14 @@
"message": "'tags' is assigned a value but never used.",
"hash": "ae9bb2e0651c118ed9efd227e88b86cc83f5d80d"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue",
"line": 116,
"column": 18,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'event' is defined but never used.",
"hash": "201f182769c6dfb87148b841e7d9b592be429669"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js",
"line": 19,
@@ -1575,6 +1767,14 @@
"message": "'app' is assigned a value but never used.",
"hash": "aaaaa63e7a60443b8cbf8191feb9142852ebdf1c"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue",
"line": 79,
"column": 13,
"ruleId": "vue/require-v-for-key",
"message": "Elements in iteration expect to have 'v-bind:key' directives.",
"hash": "422f53925922e59655d0f71624c19af75d41628c"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js",
"line": 12,
@@ -1615,6 +1815,22 @@
"message": "'evalFQDN' is assigned a value but never used.",
"hash": "7fc32caafa23addddf44f3acbc5045b4523a0271"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js",
"line": 611,
"column": 9,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'errors' is assigned a value but never used.",
"hash": "c41cf979fc1626c38328dbf1028800c3395496bd"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/App.vue",
"line": 282,
"column": 7,
"ruleId": "@typescript-eslint/no-unused-expressions",
"message": "Expected an assignment or function call and instead saw an expression.",
"hash": "de3a6e2bb10a80a2bacba665be74266c7efc7d64"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/index.js",
"line": 16,
@@ -1631,6 +1847,38 @@
"message": "'app' is assigned a value but never used.",
"hash": "2f161e663689e3e4dfe2c53b0d64c91a4d2b1a60"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue",
"line": 263,
"column": 19,
"ruleId": "vue/return-in-computed-property",
"message": "Expected to return a value in \"refreshNetwork\" computed property.",
"hash": "2c1b08a49098c83b09058cedc0a962126e91e544"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue",
"line": 270,
"column": 7,
"ruleId": "vue/no-side-effects-in-computed-properties",
"message": "Unexpected side effect in \"legendLayers\" computed property.",
"hash": "760948d2187c853f17ac9a1bd7107e883092d4f4"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue",
"line": 281,
"column": 5,
"ruleId": "vue/no-dupe-keys",
"message": "Duplicate key 'checkedLayers'. May cause name collision in script or template tag.",
"hash": "447edb461e15e3ff5c60c8ecba88131e442539aa"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue",
"line": 353,
"column": 7,
"ruleId": "@typescript-eslint/no-unused-expressions",
"message": "Expected an assignment or function call and instead saw an expression.",
"hash": "9cf656cbf1eb3d7cc0082e63adcd320b6093d14f"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/index.js",
"line": 20,
@@ -1639,6 +1887,22 @@
"message": "'app' is assigned a value but never used.",
"hash": "9e94e6412b8a44e47bfe8e66218cad09cff5bed4"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue",
"line": 42,
"column": 16,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'response' is defined but never used.",
"hash": "62de07b13c662e32332bb062038acee23978ea70"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue",
"line": 356,
"column": 28,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'_response' is defined but never used.",
"hash": "097e7788a2b5dea500b80b8a3cf968e57063a66a"
},
{
"path": "src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue",
"line": 6,
@@ -1654,5 +1918,45 @@
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'UserRenderBoxBadge' is defined but never used.",
"hash": "99eba0d8633b2c9497417f4f61ec4194dbb2a96b"
},
{
"path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts",
"line": 4,
"column": 3,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'StoredObjectStatus' is defined but never used.",
"hash": "63f8c4572293916850d6165647774b27d4b732c6"
},
{
"path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts",
"line": 5,
"column": 3,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'StoredObjectStatusChange' is defined but never used.",
"hash": "a87c178e3eb5999bf0f46b3fa1c6da77e1be08b9"
},
{
"path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts",
"line": 30,
"column": 61,
"ruleId": "@typescript-eslint/no-unused-vars",
"message": "'e' is defined but never used.",
"hash": "02953121583f4f73742a19adab099ab63df9076e"
},
{
"path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts",
"line": 31,
"column": 32,
"ruleId": "@typescript-eslint/no-explicit-any",
"message": "Unexpected any. Specify a different type.",
"hash": "af48e21a1651b6017ede882dab249c00a818a44d"
},
{
"path": "src/Bundle/ChillWopiBundle/src/Resources/public/module/pending/index.ts",
"line": 37,
"column": 16,
"ruleId": "@typescript-eslint/no-explicit-any",
"message": "Unexpected any. Specify a different type.",
"hash": "7513ea552a0a649ce4ab93b6cf9d40bfef4f68d9"
}
]

3
.gitignore vendored
View File

@@ -18,9 +18,6 @@ migrations/*
templates/*
translations/*
# we allow developers to add customization on their installation, without commiting it
config/packages/dev/*
###> symfony/framework-bundle ###
/.env.local
/.env.local.php

View File

@@ -22,16 +22,16 @@ Chill is a comprehensive web application built as a set of Symfony bundles. It i
- **Backend**: PHP 8.3+, Symfony 5.4
- **Frontend**: JavaScript/TypeScript, Vue.js 3, Bootstrap 5
- **Build Tools**: Webpack Encore, Yarn
- **Database**: PostgreSQL with materialized views. We do not support other databases.
- **Database**: PostgreSQL with materialized views
- **Other Services**: Redis, AMQP (RabbitMQ), SMTP
## Project Structure
Note: This is a project that's existed for a long time, and throughout the years we've used multiple structures inside each bundle. When having the choice, the developers should choose the new structure.
Note: This is a project which exists from a long time ago, and we found multiple structure inside each bundle. When having the choice, the developers should choose the new structure.
The project follows a standard Symfony bundle structure:
- `/src/Bundle/`: Contains all the Chill bundles. The code is either at the root of the bundle directory, or within a `src/` directory (preferred). See psr4 mapping at the root's `composer.json`.
- each bundle comes with its own tests, either in the `Tests` directory (when the code is directly within the bundle directory (for instance `src/Bundle/ChillMainBundle/Tests`, `src/Bundle/ChillPersonBundle/Tests`)), or inside the `tests` directory, alongside the `src/` sub-directory (example: `src/Bundle/ChillWopiBundle/tests`) (this is the preferred way).
- each bundle come with his own tests, either in the `Tests` directory (when the code is directly within the bundle directory (for instance `src/Bundle/ChillMainBundle/Tests`, `src/Bundle/ChillPersonBundle/Tests`)), or inside the `tests` directory, alongside to the `src/` sub-directory (example: `src/Bundle/ChillWopiBundle/tests`) (this is the preferred way).
- `/docs/`: Contains project documentation
Each bundle typically has the following structure:
@@ -46,13 +46,13 @@ Each bundle typically has the following structure:
### A special word about TicketBundle
The ticket bundle is developed using a kind of "Command" pattern. The controller fills a "Command," and a "CommandHandler" handles this command. They are saved in the `src/Bundle/ChillTicketBundle/src/Action` directory.
The ticket bundle is developed using a kind of "Command" pattern. The controller fill a "Command", and a "CommandHandler" handle this command. They are savec in the `src/Bundle/ChillTicketBundle/src/Action` directory.
## Development Guidelines
### Building and Configuration Instructions
All the commands should be run through the `symfony` command, which will configure the required variables.
All the command should be run through the `symfony` command, which will configure the required variables.
For assets, we must ensure that we use node at version `^20.0.0`. This is done using `nvm use 20`.
@@ -87,7 +87,7 @@ For assets, we must ensure that we use node at version `^20.0.0`. This is done u
docker compose up -d
```
6. **Set Up the Database**:
5. **Set Up the Database**:
```bash
# Create the database
symfony console doctrine:database:create
@@ -99,20 +99,20 @@ For assets, we must ensure that we use node at version `^20.0.0`. This is done u
symfony console doctrine:fixtures:load
```
7. **Build Assets**:
6. **Build Assets**:
```bash
nvm use 20
yarn run encore dev
```
8. **Start the Development Server**:
7. **Start the Development Server**:
```bash
symfony server:start -d
```
#### Docker Setup
The project includes a Docker configuration for easier development:
The project includes Docker configuration for easier development:
1. **Start Docker Services**:
```bash
@@ -149,97 +149,21 @@ Key configuration files:
- `package.json`: JavaScript dependencies and scripts
- `.env`: Default environment variables. Must usually not be updated: use `.env.local` instead.
### Database migrations
Each time a doctrine entity is created, we generate migration to adapt the database.
The migration is created using the command `symfony console doctrine:migrations:diff --no-interaction --namespace <namespace>`, where the namespace is the relevant namespace for migration. As this is a bash script, remember to quote the `\` (`\` must become `\\` in your command).
Each bundle has his own namespace for migration (always ask me to confirm that command with a list of updated / created entities so that I can confirm to you that it is ok):
- `Chill\Bundle\ActivityBundle` writes migrations to `Chill\Migrations\Activity`;
- `Chill\Bundle\BudgetBundle` writes migrations to `Chill\Migrations\Budget`;
- `Chill\Bundle\CustomFieldsBundle` writes migrations to `Chill\Migrations\CustomFields`;
- `Chill\Bundle\DocGeneratorBundle` writes migrations to `Chill\Migrations\DocGenerator`;
- `Chill\Bundle\DocStoreBundle` writes migrations to `Chill\Migrations\DocStore`;
- `Chill\Bundle\EventBundle` writes migrations to `Chill\Migrations\Event`;
- `Chill\Bundle\CalendarBundle` writes migrations to `Chill\Migrations\Calendar`;
- `Chill\Bundle\FamilyMembersBundle` writes migrations to `Chill\Migrations\FamilyMembers`;
- `Chill\Bundle\FranceTravailApiBundle` writes migrations to `Chill\Migrations\FranceTravailApi`;
- `Chill\Bundle\JobBundle` writes migrations to `Chill\Migrations\Job`;
- `Chill\Bundle\MainBundle` writes migrations to `Chill\Migrations\Main`;
- `Chill\Bundle\PersonBundle` writes migrations to `Chill\Migrations\Person`;
- `Chill\Bundle\ReportBundle` writes migrations to `Chill\Migrations\Report`;
- `Chill\Bundle\TaskBundle` writes migrations to `Chill\Migrations\Task`;
- `Chill\Bundle\ThirdPartyBundle` writes migrations to `Chill\Migrations\ThirdParty`;
- `Chill\Bundle\TicketBundle` writes migrations to `Chill\Migrations\Ticket`;
- `Chill\Bundle\WopiBundle` writes migrations to `Chill\Migrations\Wopi`;
Once created the, comment's classes should be removed and a description of the changes made to the entities should be added to the migrations, using the `getDescription` method. The migration should not be cleaned by any artificial intelligence, as modifying this migration is error prone.
### Guidelines related to code structure and requirements
#### Usage of clock
When we need to use a DateTime or DateTimeImmutable that need to express "now", we prefer the usage of
`Symfony\Component\Clock\ClockInterface`, where possible. This is usually not possible in doctrine entities,
where injection does not work when restoring an entity from a database, but usually possible in services.
In test, we use `\Symfony\Component\Clock\MockClock` which is an implementation of `Symfony\Component\Clock\ClockInterface`
where we have full and easy control of the date.
### Testing Information
The project uses PHPUnit for testing. Each bundle has its own test suite, and there's also a global test suite at the root level.
#### Use of mock in tests
##### General mocking
For creating mock, we prefer using prophecy (library phpspec/prophecy).
##### Useful helpers and tips that avoid creating a mock
Some notable implementations that are test helpers and avoid creating a mock:
- `\Psr\Log\NullLogger`, an implementation of `\Psr\Log\LoggerInterface`;
- `\Symfony\Component\Clock\MockClock`, an implementation of `Symfony\Component\Clock\ClockInterface` (already mentioned above);
- `\Symfony\Component\HttpClient\MockHttpClient`, an implementation of `\Symfony\Contracts\HttpClient\HttpClientInterface`;
- When using `\Symfony\Component\Mailer\MailerInterface`, we can create the mock with "InMemoryTransport":
```php
use Symfony\Component\Mailer\Transport\InMemoryTransport;
use \Symfony\Component\Mailer\Mailer;
$transport = new InMemoryTransport();
$mailer = new Mailer($transport);
// After sending:
$messages = $transport->getSent(); // array of SentMessage
```
- When using `\Symfony\Contracts\EventDispatcher\EventDispatcherInterface`, we can use directly an instance of `\Symfony\Component\EventDispatcher\EventDispatcher`;
##### When we prefer not creating a mock
- When we use Doctrine Entities related to the project, we prefer not to use a mock: we instantiate them directly (unless it requires too much code to write);
##### Mocking final and readonly classes
Classes marked as final can't be mocked. To avoid that, either:
- we remove the `final` keyword from the class;
- we extract an interface from the final class.
This must be a decision made by a human, not by an AI. Every AI task must abort with an explicit message in that case.
#### Running Tests
The tests are run from the project's root (not from the bundle's root).
```bash
# Run all tests
vendor/bin/phpunit
# Run tests for a specific bundle
vendor/bin/phpunit --testsuite NameBundle
# Run a specific test file
vendor/bin/phpunit path/to/TestFile.php
@@ -247,9 +171,6 @@ vendor/bin/phpunit path/to/TestFile.php
vendor/bin/phpunit --filter methodName path/to/TestFile.php
```
When writing tests, only test specific files. Do not run all tests or the full
test suite.
#### Test Structure
Tests are organized by bundle and follow the same structure as the bundle itself:
@@ -297,7 +218,7 @@ class TicketTest extends TestCase
#### Test Database
For tests that require a database, the project uses a postgresql database filled with fixtures (usage of doctrine-fixtures). You can configure a different database for testing in the `.env.test` file.
For tests that require a database, the project uses an in-memory SQLite database by default. You can configure a different database for testing in the `.env.test` file.
### Code Quality Tools

View File

@@ -6,257 +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.7.0 - 2025-11-10
### Feature
* ([#385](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/385)) Create invitation list in user menu
* ([#404](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/404)) Add columns for comments linked to an activity in the activity list export
### Fixed
* ([#451](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/451)) Fix: display also social actions linked to parents of the selected social issue
* ([#453](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/453)) Fix: export actions and their results in csv even when action does not have any goals attached to it.
* Fix the possibility to delete a workflow
**Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed
* ([#457](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/457)) Fix the fusion of thirdparty properties that are located in another schema than public for TO_ONE relations + add extra loop for MANY_TO_MANY relations where thirdparty is the source instead of the target
* ([#428](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/428)) Fix suggestion of referrer when creating notification for accompanyingPeriodWorkDocument
### DX
* Send notifications log to dedicated channel, if it exists
### UX
* ([#425](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/425)) Change the terms 'cercle' and 'centre' to 'service', and 'territoire' respectively.
* ([#542](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/542)) Improve the ux for selecting whether user wants to be notified of the final step of a workflow or all steps
* Expand timeSpent choices for evaluation document and translate them to user locale or fallback 'fr'
* ([#455](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/455)) Change the order of display for results and objectives in the social work/action form
* Wrap text when it is too long within badges
## v4.6.1 - 2025-10-27
### Fixed
* Fix export case where no 'reason' is picked within the PersonHavingActivityBetweenDateFilter.php
## v4.6.0 - 2025-10-15
### Feature
* ([#423](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/423)) Create environment banner that can be activated and configured depending on the image deployed
* ([#394](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/394)) Only show active workflow on the page "my tracked workflow"
### Fixed
* Fix loading of classLists in SocialIssuesAcc.vue, ensure elements are present
* Fix the rendering of list of StoredObjectVersions, where there are kept version (before converting to pdf) and intermediate versions deleted
* ([#434](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/434)) Notification: fix editing of sent notification by removing form.addressesEmails, a field that no longer exists
* Fix loading of social issues and social actions within vue component
* ([#446](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/446)) Add unique condition on stored object filename, with cleaning step on existing duplicate filenames
**Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed
* [workflow] take permissions into account to delete the workflow attachment
* ([#448](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/448)) Fix the execution of daily cronjob notification, when the previous last execution storage was invalid
## v4.5.1 - 2025-10-03
### Fixed
* Add missing javascript dependency
* Add exception handling for conversion of attachment on sending external, when documens are already in pdf
## v4.5.0 - 2025-10-03
### Feature
* Only allow delete of attachment on workflows that are not final
* Move up signature buttons on index workflow page for easier access
* Filter out document from attachment list if it is the same as the workflow document
* Block edition on attached document on workflow, if the workflow is finalized or sent external
* Convert workflow's attached document to pdf while sending them external
* After a signature is canceled or rejected, going to a waiting page until the post-process routines apply a workflow transition
### Fixed
* ([#426](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/426)) Increased the number of required characters when setting a new password in Chill from 9 to 14 - GDPR compliance
* Fix permissions on storedObject which are subject by a workflow
### DX
* Introduce a WaitingScreen component to display a waiting screen
## v4.4.2 - 2025-09-12
### Fixed
* Fix document generation and workflow generation do not work on accompanying period work documents
## v4.4.1 - 2025-09-11
### Fixed
* fix translations in duplicate evaluation document modal and realign close modal button
## v4.4.0 - 2025-09-11
### Feature
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
* ([#369](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/369)) Duplication of a document to another accompanying period work evaluation
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Fusion of two accompanying period works
### Fixed
* Fix display of 'duplicate' and 'merge' buttons in CRUD templates
* Fix saving notification preferences in user's profile
## v4.3.0 - 2025-09-08
### Feature
* ([#409](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/409)) Add 45 and 60 min calendar ranges
* Add a command to generate a list of permissions
* ([#412](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/412)) Add an absence end date
**Schema Change**: Add columns or tables
### Fixed
* fix date formatting in calendar range display
* Change route URL to avoid clash with person duplicate controller method
## v4.2.1 - 2025-09-03
### Fixed
* Fix exports to work with DirectExportInterface
### DX
* Improve error message when a stored object cannot be written on local disk
## v4.2.0 - 2025-09-02
### Feature
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
**Schema Change**: Add columns or tables
* ([#330](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/330) Allow users to choose for which notifications they want to receive an email
### Fixed
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
* Fix typo in 'uncheckAll' script for centers selection
* Fix incorrect parameter name in event details link
## v4.1.0 - 2025-08-26
### Feature
* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes
* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default
* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports
**Schema Change**: Add columns or tables
### Fixed
* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed.
* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType
### UX
* Limit display of participations in event list
## v4.0.2 - 2025-07-09
### Fixed
* Fix add missing translation
* Fix the transfer of evaluations and documents during of accompanyingperiodwork
## v4.0.1 - 2025-07-08
### Fixed
* Fix package.json for compilation
## v4.0.0 - 2025-07-08
### Feature
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
### Fixed
* ([#390](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/390)) Display the list of participant in the results, even if there is only one participant and that the search result display the requestor
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* Fix translations for social action fields in admin form: results, goals, evaluations
### DX
* Rewrite exports to run them asynchronously
**Schema Change**: Add columns or tables
* Allow TranslatableMessage in flash messages
### UX
* Improve labeling of fields in person resource creation form
**Release notes**
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
```diff
# config/packages/messenger.yaml
framework:
messenger:
routing:
+ 'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority
```
- add missing methods to exports, aggregators, filters, formatter:
```php
public function normalizeFormData(array $formData): array;
public function denormalizeFormData(array $formData, int $fromVersion): array;
```
There are rector rules to generate those methods:
- `Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector`
See:
```php
// upgrade chill exports
$rectorConfig->rules([\Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector::class]);
```
This rule will create most of the work necessary, but some manuals changes are still necessary:
- we must set manually the correct repository for method `denormalizeDoctrineEntity`;
- when the form data contains some entities, and the form type is not one of EntityType::class, PickUserDynamicType::class, PickUserLocationType::class, PickThirdpartyDynamicType::class, Select2CountryType::class, then we must handle the normalization manually (using the `\Chill\MainBundle\Export\ExportDataNormalizerTrait`)
## v3.12.1 - 2025-06-30
### Fixed
* Fix loading of the list of documents
## v3.12.0 - 2025-06-30
### Feature
* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title.
* Add desactivation date for social action and issue csv export
* Add Emoji and Fullscreen feature to ckeditor configuration
* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor
* Do not remove workflow which are automatically canceled after staling for more than 30 days
### Fixed
* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history
* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course
* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events
* Add missing translation for user_group.no_user_groups
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* ([#392](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/392)) Allow null and cast as string to setContent method for NewsItem
* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment.
### DX
* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module
* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required)
### UX
* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
* Improve labeling of fields in person resource creation form
## 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
## v3.10.3 - 2025-03-18
### DX
* Eslint fixes

View File

@@ -14,7 +14,7 @@
"ext-openssl": "*",
"ext-redis": "*",
"ext-zlib": "*",
"champs-libres/wopi-bundle": "dev-symfony-v5@dev",
"champs-libres/wopi-bundle": "dev-master@dev",
"champs-libres/wopi-lib": "dev-master@dev",
"doctrine/data-fixtures": "^1.8",
"doctrine/doctrine-bundle": "^2.1",

View File

@@ -2,6 +2,7 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
loophp\PsrHttpMessageBridgeBundle\PsrHttpMessageBridgeBundle::class => ['all' => true],
ChampsLibres\WopiBundle\WopiBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
@@ -36,5 +37,4 @@ return [
Chill\WopiBundle\ChillWopiBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true],
loophp\PsrHttpMessageBridgeBundle\PsrHttpMessageBridgeBundle::class => ['all' => true],
];

View File

@@ -1,13 +1,6 @@
chill_main:
available_languages: [ '%env(resolve:LOCALE)%', 'en', 'nl' ]
available_languages: [ '%env(resolve:LOCALE)%', 'en' ]
available_countries: ['BE', 'FR']
top_banner:
visible: false
text:
fr: 'Vous travaillez actuellement avec la version de PRÉ-PRODUCTION.'
nl: 'Je werkt momenteel in de PRE-PRODUCTIE versie'
color: '#353535'
background_color: '#d8bb48'
notifications:
from_email: '%env(resolve:NOTIFICATION_FROM_EMAIL)%'
from_name: '%env(resolve:NOTIFICATION_FROM_NAME)%'

View File

@@ -1,2 +0,0 @@
chill_aside_activity:
show_concerned_persons_count: hidden

View File

@@ -62,10 +62,8 @@ framework:
'Chill\MainBundle\Workflow\Messenger\PostSignatureStateChangeMessage': priority
'Chill\MainBundle\Workflow\Messenger\PostPublicViewMessage': async
'Chill\MainBundle\Service\Workflow\CancelStaleWorkflowMessage': async
'Chill\MainBundle\Notification\Email\NotificationEmailMessages\SendImmediateNotificationEmailMessage': async
'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority
'Chill\MainBundle\Export\Messenger\RemoveExportGenerationMessage': async
'Chill\MainBundle\Notification\Email\NotificationEmailMessages\ScheduleDailyNotificationDigestMessage': async
# end of routes added by chill-bundles recipes
# Route your messages to the transports
# 'App\Message\YourMessage': async

View File

@@ -1,16 +1,25 @@
# Makefile for MkDocs documentation
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
MKDOCS = mkdocs
BUILDDIR = site
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for mkdocs
ifeq ($(shell which $(MKDOCS) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(MKDOCS)' command was not found. Make sure you have MkDocs installed with 'pip install mkdocs mkdocs-material', then make sure the mkdocs executable is in your PATH.)
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
.PHONY: help clean html serve build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"

View File

@@ -10,26 +10,20 @@ Compilation into HTML
To compile this documentation :
1. Install [MkDocs](https://www.mkdocs.org/) and MkDocs Material
1. Install [sphinx-doc](http://sphinx-doc.org)
``` bash
$ virtualenv .venv # creation of the virtual env (only the first time)
$ source .venv/bin/activate # activate the virtual env
(.venv) $ pip install -r requirements.txt
```
2. Install submodules : $ git submodule update --init;
3. run `make html` or `mkdocs build` from the root directory
4. The base file is located on site/index.html
3. run `make html` from the root directory
4. The base file is located on build/html/index.html
``` bash
$ cd site
$ cd build/html
$ python -m http.server 8888 # will serve the site on the port 8888
```
Alternatively, you can use the built-in development server:
``` bash
(.venv) $ mkdocs serve
```
This will start a development server at http://127.0.0.1:8000/ with live reload.
Contribute
===========

View File

@@ -1,137 +0,0 @@
site_name: Chill Documentation
site_description: Documentation for Chill - A free software for social workers
site_url: https://docs.chill.social
repo_url: https://gitlab.com/Chill-project/chill-bundles
repo_name: Chill-project/chill-bundles
docs_dir: source
copyright: Copyright &copy; 2014-2024 Champs-Libres Cooperative SCRLFS - GNU Free Documentation License v1.3
theme:
name: material
language: en
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.expand
- navigation.path
- navigation.top
- search.highlight
- search.share
- search.suggest
- toc.follow
- content.code.copy
- content.code.annotate
palette:
# Palette toggle for light mode
- scheme: default
primary: blue
accent: blue
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- scheme: slate
primary: blue
accent: blue
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono
plugins:
- search
- autorefs
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- toc:
permalink: true
- tables
- attr_list
- md_in_html
nav:
- Home: index.md
- Installation:
- installation/index.md
- Development: installation/installation-development.md
- Production: installation/installation-production.md
- Document Storage: installation/document-storage.md
- Load Addresses: installation/load-addresses.md
- Production Setup: installation/prod.md
- Calendar SMS: installation/prod-calendar-sms-sending.md
- MS Graph Configuration: installation/msgraph-configure.md
- Enable Collabora: installation/enable-collabora-for-dev.md
- Development:
- development/index.md
- Access Control: development/access_control_model.md
- API: development/api.md
- Assets: development/assets.md
- Code Quality: development/code-quality.md
- Create Bundle: development/create-a-new-bundle.md
- Cronjobs: development/cronjob.md
- CRUD: development/crud.md
- Database Principles: development/database-principles.md
- Embeddable Comments: development/embeddable-comments.md
- Entity Info: development/entity-info.md
- ESLint: development/es-lint.md
- Exports: development/exports.md
- FAQ: development/FAQ.md
- Forms: development/forms.md
- Localisation: development/localisation.md
- Logging: development/logging.md
- Manual:
- development/manual/index.md
- Routing and Menus: development/manual/routing-and-menus.md
- Menus: development/menus.md
- Messages to Users: development/messages-to-users.md
- Migrations: development/migrations.md
- Pagination: development/pagination.md
- Render Entity: development/render-entity.md
- Routing: development/routing.md
- Run Tests: development/run-tests.md
- Searching: development/searching.md
- Timelines: development/timelines.md
- Useful Snippets: development/useful-snippets.md
- User Interface:
- CSS Classes: development/user-interface/css-classes.md
- JS Functions: development/user-interface/js-functions.md
- Layout Template: development/user-interface/layout-template-usage.md
- Widgets: development/user-interface/widgets.md
- Bundles:
- bundles/index.md
- Activity: bundles/activity.md
- Custom Fields: bundles/custom-fields.md
- Event: bundles/event.md
- Group: bundles/group.md
- LDAP: bundles/ldap.md
- Main: bundles/main.md
- Person: bundles/person.md
- Report: bundles/report.md
extra:
social:
- icon: fontawesome/brands/gitlab
link: https://gitlab.com/Chill-project
- icon: fontawesome/solid/comments
link: https://app.element.io/#/room/#chill-social-admin:matrix.org

View File

@@ -1,4 +1,7 @@
mkdocs>=1.5.0
mkdocs-material>=9.4.0
pymdown-extensions>=10.3.0
mkdocs-autorefs>=0.5.0
docutils==0.13.1
Pygments==2.2.0
sphinx==1.8.5
Jinja2<3.1
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
jsx-lexer===0.0.8
sphinx_rtd_theme==0.5.0

View File

@@ -23,8 +23,8 @@ class "Document" {
- text description
- ArrayCollection_DocumentCategory categories
- varchar_150 content #link to openstack
- Territoire territoire
- Service service
- Center center
- Cercle cercle
- User user
- DateTime date # Creation date
}

View File

@@ -1,55 +0,0 @@
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".
# Activity bundle
This bundle provides the ability to record people in the software. This bundle is required by other bundle.
:local:
###### Entities provided
Describe the entities provided.
###### Configuration options
Those options are available under `chill_activity` key.
Example of configuration:
chill_activity:
form:
time_duration:
- { label: '12 minutes', seconds: 720 }
- { label: '30 minutes', seconds: 1800 }
form.time_duration *array*
The duration which might be suggested when the user create or update an activity. The value must be an array of object, where each object must have a `label` and a `seconds` key. The label provide which is shown to user (the label will be translated, if possible) and the seconds the duration.
Example: see the example above
Default value: the values available are 5, 10, 15, 20, 25, 30, 45 minutes, and 1 hour, 1 hour 15, 1 hour 30, 1 hour 45 and 2 hours.
###### Macros
## Activity reason sticker
Macro file
`ChillActivityBundle:ActivityReason:macro.html.twig`
Macro envelope
`reason(r)`
`p` is an instance of :class:`Chill\ActivityBundle\Entity\ActivityReason`
When to use this macro ?
When you want to represent an activity reason.
Example usage :
```jinja
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
{{ m.reason(r) }}
```

View File

@@ -35,12 +35,12 @@ Example of configuration:
chill_activity:
form:
time_duration:
time_duration:
- { label: '12 minutes', seconds: 720 }
- { label: '30 minutes', seconds: 1800 }
form.time_duration *array*
The duration which might be suggested when the user create or update an activity. The value must be an array of object, where each object must have a `label` and a `seconds` key. The label provide which is shown to user (the label will be translated, if possible) and the seconds the duration.
The duration which might be suggested when the user create or update an activity. The value must be an array of object, where each object must have a :code:`label` and a :code:`seconds` key. The label provide which is shown to user (the label will be translated, if possible) and the seconds the duration.
Example: see the example above
@@ -57,9 +57,9 @@ Activity reason sticker
Macro file
`ChillActivityBundle:ActivityReason:macro.html.twig`
Macro envelope
`reason(r)`
:code:`reason(r)`
`p` is an instance of :class:`Chill\ActivityBundle\Entity\ActivityReason`
:code:`p` is an instance of :class:`Chill\ActivityBundle\Entity\ActivityReason`
When to use this macro ?
When you want to represent an activity reason.

View File

@@ -1,381 +0,0 @@
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".
## Custom fields bundle
This bundle provides the ability to add custom fields to existing entities.
Those custom fields contains extra data and will be stored in the DB, along with other data's entities. It may be string, text, date, ... or a link to an existing entities.
In the database, custom fields are stored in json format.
The full specification discussed [here. ](https://redmine.champs-libres.coop/issues/239)
[JSON Type on postgresql documentation ](http://www.postgresql.org/docs/9.3/static/datatype-json.html)
The documentation of json type, which is used to store data in the database.
:depth: 4
:local:
### Custom Fields concepts
Custom fields are extra data which may be added to entities by user. If a developer implements custom fields on a entity, users will be able to add more fields on this entity.
Example: the [person bundle` allows to record `firstname`, `lastname`, `date of birth` fields. But users need to store information about the kind of house he has (if he owns his house, if he rents it, ...). Custom fields allows to create those fields.
Automatically, those fields are added at the person form. They are also printed in the person view and in exports.
##### Custom fields and custom fields group
Custom fields are associated to a custom fields group. When a user want to add custom fields on an entity, he must first create a custom fields group and associate this field with an entity. Then he may add add custom fields to this groups.
Some entities needs a **default** custom fields group. For instance, the default custom fields group will be printed on the main form for person, and will be appended on the main person view. Some bundle does not use this feature (i.e. the `report` bundle).
In the future of the `person bundle`, other custom fields group will be added in forms accessible from the menu, allowing users to completely customize and separate their entities.
### Allow custom fields on an entity
As a developer, you must allow your users to add custom fields on your entities.
For having custom fields, the class of the entity must contain a variable for storing the custom data. **By convention this variable must be called $cFData**
##### Create a json field on your entity
Declare a json field in your database :
Chill\CustomFieldsBundle\Entity\BlopEntity:
type: entity
# ...
fields:
cFData:
type: json_array
Create the field accordingly in the class logic :
namespace Chill\CustomFieldsBundle\Entity;
/**
* BlopEntity
*/
class BlopEntity
{
/**
* @var array
*/
private $cFData;
/**
* You must set a setter in order to save automatically custom
* fields from forms, using Form Component
*
* @param array $cFData
* @return BlopEntity
*/
public function setCFData(array $cFData)
{
$this->cFData = $cFData;
return $this;
}
/**
* You also must create a getter in order to let Form
* component populate form fields
*
* @return array
*/
public function getCFData()
{
return $this->cFData;
}
##### Declare your customizable entity in configuration
This step is necessary to allow user to create custom fields group associated with this entity.
Two methods are available.
The recommended method is to do it in DependencyInjection/Extension class. It is recommended as your bundle will be well set up (for custom field) in every chill installation that use it.
The discouraged method is to declare via the app/config.yml file. This is very quick to set up for a given chill installation but it is not done automatically : in every chill installation that use your bundle, this step has to be performed.
In app/config.yml file (discouraged)
""""""""""""""""""""""""""""""""""""
This method is discouraged but explained first as it helps to undersand the recommended method.
Add those file under `chill_custom_fields` section :
chill_custom_fields:
customizables_entities:
- { class: Chill\YourBundleBundle\Entity\BlopEntity, name: blop_entity }
* The `name` allow you to define a string which is translatable. This string will appears when chill's admin will add/retrieve new customFieldsGroup.
* The class, which is a full FQDN class path
Automatically, in DependencyInjection/Extension class (recommended)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This is the recommended way for declaring customizable classes.
You can prepend configuration of `custom fields bundle` from the class `YourBundle\DependencyInjection\YourBundleExtension`. **Note** that you also have to implements `Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface` on this class to make the `prepend` function being taken into account.
Example here :
class ChillYourBundleExtension extends Extension implements PrependExtensionInterface
{
/**
* @param ContainerBuilder $container
*/
public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['ChillCustomFieldsBundle'])) {
throw new MissingBundleException('ChillCustomFieldsBundle');
}
$container->prependExtensionConfig('chill_custom_fields',
array('customizables_entities' =>
array(
array(
'class' => 'Chill\YourBundleBundle\Entity\BlopEntity',
'name' => 'blop_entity',)
)
)
);
}
}
* The `name` allow you to define a string which is translatable. This string will appears when chill's admin will add/retrieve new customFieldsGroup.
* The class, which is a full FQDN class path
`How to simplify configuration of multiple bundles ](http://symfony.com/doc/current/cookbook/bundles/prepend_extension.html)
A cookbook page about prepending configuration.
##### Adding options to your custom fields groups
You may add options to the groups associated with an entity.
In `config.yml` the declaration should be :
chill_custom_fields:
customizables_entities:
-
class: Chill\YourBundleBundle\Entity\BlopEntity
name: BlopEntity
options:
# this will create a "myFieldKey" field as text, with a maxlength attribute to 150 (see http://symfony.com/doc/master/reference/forms/types/text.html)
myFieldKey: {form_type: text, form_options: {attr: [maxlength: 150]}}
In the `PrependExtensionInterface::prepend` function, the options key will be added in the configuration definition :
class ChillYourBundleExtension extends Extension implements PrependExtensionInterface
{
/**
* @param ContainerBuilder $container
*/
public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['ChillCustomFieldsBundle'])) {
throw new MissingBundleException('ChillCustomFieldsBundle');
}
$container->prependExtensionConfig('chill_custom_fields',
array('customizables_entities' =>
array(
array(
'class' => 'Chill\YourBundleBundle\Entity\BlopEntity',
'name' => 'BlopEntity',
'options' => array(
'myFieldKey' => [ 'form_type' => 'text', 'form_options' => [ 'attr' => [ 'maxlength' => 150 ] ]
))
)
)
);
}
}
**Example :** the entity `Report` from **ReportBundle** has to pick some custom fields belonging to a group to print them in *summaries* the timeline page. The definition will use the special type `custom_fields_group_linked_custom_field` which will add a select input with all fields associated with the current custom fields group :
class ChillReportExtension extends Extension implements PrependExtensionInterface
{
/**
###### *
* @param ContainerBuilder $container
*/
public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['ChillCustomFieldsBundle'])) {
throw new MissingBundleException('ChillCustomFieldsBundle');
}
$container->prependExtensionConfig('chill_custom_fields',
array('customizables_entities' =>
array(
array(
'class' => 'Chill\ReportBundle\Entity\Report',
'name' => 'ReportEntity',
'options' => array(
'summary_fields' => array(
'form_type' => 'custom_fields_group_linked_custom_fields',
'form_options' =>
[
'multiple' => true,
'expanded' => false
]
)
))
)
)
);
}
}
Note that `custom_fields_group_linked_custom_fields` does not create any input on `CustomFieldsGroup` creation : there aren't any fields associated with the custom fields just after the group creation... You have to add custom fields and associate them with the newly created group to see them appears.
### Rendering custom fields and custom fields group in a template
Each custom field can be `active` or not. Only `active` custom fields has to be dislayed.
For rendering custom fields, two function are available :
* `chill_custom_field_widget` to render the widget. This function is defined on a customFieldType basis.
* `chill_custom_field_label` to render the label. You can customize the label rendering by choosing the layout you would like to use.
* `chill_custom_field_is_empty` indicates if the content of the custom fields is empty (return a boolean)
For rendering custom fields group, a function is available :
* `chill_custom_fields_group_widget` to render the widget. It will display the custom fields of the group in a dd / dt structure.
##### chill_custom_field_label
The signature is :
* `CustomField` **$customField** a customField instance
* `array` **params** the parameters for rendering. Currently, 'label_layout' allow to choose a different label. Default is 'ChillCustomFieldsBundle:CustomField:render_label.html.twig'
Examples
{{ chill_custom_field_label(customField) }}
##### chill_custom_field_widget
The signature is :
* array **$fields** the array raw, as stored in the db
* CustomField **$customField** a customField instance
* string **$documentType** the type of document. Default to `html`.
Examples:
{{ chill_custom_field_widget(entity.customFields, customField) }}
##### chill_custom_field_is_empty
The signature is :
* array **$fields** the array raw, as stored in the db
* CustomField **$customField** a customField instance
Examples :
{%- if chill_custom_field_is_empty(cFData, customField) == false -%}
##### chill_custom_fields_group_widget
This function only display custom fields that are `active`.
The signature is :
* array **$fields** the array raw, as stored in the db
* CustomFieldsGroup **$customFieldsGroup** the custom field group to render
{{ chill_custom_fields_group_widget(entity.cFData, entity.customFieldsGroup) }}
### Custom Fields's form
You should simply use the 'custom_field' type in a template, with the group you would like to render in the `group` option's type.
Example :
namespace Chill\ReportBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ReportType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$entityManager = $options['em'];
$builder
->add('user')
->add('date', 'date',
array('required' => true, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy'))
#add the custom fields :
->add('cFData', 'custom_field',
array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup']))
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ReportBundle\Entity\Report'
));
$resolver->setRequired(array(
'em',
'cFGroup',
));
$resolver->setAllowedTypes(array(
'em' => 'Doctrine\Common\Persistence\ObjectManager',
'cFGroup' => 'Chill\CustomFieldsBundle\Entity\CustomFieldsGroup'
));
}
/**
* @return string
*/
public function getName()
{
return 'chill_reportbundle_report';
}
}
### Available configuration
Those options are available in the configuration, under the `chill_custom_field` key.
Example :
chill_custom_field:
show_empty_values_in_views: false
show_empty_values_in_views *boolean*:
Allow to hide / show empty values in views. The aim of this configuration parameter is to hide (or show) empty values when :term:`custom fields group` are rendered.
Default value : `true`
### Glossary
custom fields group
A group of custom fields

View File

@@ -1,23 +0,0 @@
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".
# Event bundle
## Template & Menu
The event bundle has a special template with a specific menu for actions on
events. This menu is called `event`.
### ChillEventBundle::layout.html.twig
This layout extends `ChillMainBundle::layoutWithVerticalMenu.html.twig` and add the menu `event`
It proposes a new block :
* event_content
* where to display content relative to the event.

View File

@@ -1,34 +0,0 @@
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".
# Group bundle
Allow to group people in a group. This group may be a family, an activity group, ...
:local:
###### Entities
###### Macros
## Group sticker
Macro file
`ChillGroupBundle:Group:macro.html.twig`
Macro name
`_render`
Macro envelope
`group`, instance of :class:`Chill\GroupBundle\Entity\CGroup`
When to use this macro ?
When you want to represent group.
Example usage :
```jinja
{% import 'ChillGroupBundle:Group:macro.html.twig' as m %}
{{ m._render(g) }}
```

View File

@@ -33,9 +33,9 @@ Group sticker
Macro file
`ChillGroupBundle:Group:macro.html.twig`
Macro name
`_render`
:code:`_render`
Macro envelope
`group`, instance of :class:`Chill\GroupBundle\Entity\CGroup`
:code:`group`, instance of :class:`Chill\GroupBundle\Entity\CGroup`
When to use this macro ?
When you want to represent group.

View File

@@ -1,23 +0,0 @@
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".
# Bundles documentation
You will find here documentation about bundles working with Chill.
- [Main bundle](main.md)
- [Custom Fields bundle](custom-fields.md)
- [Person bundle](person.md)
- [Report bundle](report.md)
- [Activity bundle](activity.md)
- [Group bundle](group.md)
- [Event bundle](event.md)
- [Ldap bundle (synchronisation between ldap and database)](ldap.md)
### Your bundle here ?
The contributors still do not have a policy about those bundle integration, but we would like to be very open on this subject. Please write to us [or open an issue ](https://redmine.champs-libres.coop/projects/chill/issues).

View File

@@ -1,159 +0,0 @@
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".
# LDAP bundle
This bundle binds the database with an ldap directory.
The bundle synchronize the ldap directory with users in the database. It also
provides a way to check user credentials against the ldap directory.
:local:
###### Current limitations
- The length of the ldap dn must be < 255 characters
- if the username extracted from the ldap is updated, the changes are not reflected in the database and remains the same
###### Entities provided
This bundle provides only one entity : :class:[Chill\\LdapBundle\\Entity\\UserLdapBinding`
###### How the synchronizer works ?
#. The synchronizer performs a query on `dn` and `query` defined in the [configuration ](configuration.md).
#. For each entry returned by the query, it looks if the `dn` exists in the database
#. If the entry does not exists :
#. the synchronizer looks for user with same username as defined by `username_attr`, and bind it with the `dn` if it exists.
#. else, a user is created with username defined by `username_attr` (if the ldap contains more than one attribute, the first attribute returned is used)
#. if a user exists which is already binded with the `dn`, the entry is ignored.
#. The synchronizer looks for dn existing in database and which were not returned by the query performed in 1.
#. If they exists, those user are set to `enabled=false`: they are not allowed to login.
###### Installation
This bundle requires :
- PHP LDAP ext
- `symfony/ldap` with minimal version 3.1. Note that, currently, Chill uses Symfony 2.8: you should add the dependency on this single package manually
In your composer.json, for stable version :
"require": {
// .. other dependencies
"symfony/ldap" : "~3.1",
"chill-project/ldap": "~1.0"
}
And for dev version :
"require": {
// .. other dependencies
"symfony/ldap" : "~3.1",
"chill-project/ldap": "dev-master@dev"
}
###### Configuration
## Configuration of the bundle
# Default configuration for extension with alias: "chill_ldap"
chill_ldap:
server: # Required
# the host of the ldap directory
host: ~ # Required, Example: localhost
# the port to reach the ldap directory
port: 389
# the version of the ldap directory
version: 3
# Is the use of ssl required to establish connection
use_ssl: false
# Is the use of startssl required to establish connection
use_starttls: false
# the user to bind to dn directory. Required for searching existing users.
bind_dn: ~ # Required, Example: cn=user,dn=chill,dn=social
# the user's password to bind to dn directory.
bind_password: ~ # Required, Example: paSSw0rD
user_query: # Required
# The DN where the query is executed
dn: ~ # Example: ou=People,dc=champs-libres,dc=coop
# The query which will allow to retrieve users
query: ~ # Example: (&(objectClass=inetOrgPerson)(userPassword=*))
# The attribute which will provide username (=login)
username_attr: cn
Example :
chill_ldap:
server:
# host, bind_dn and bind_password are imported from parameters.yml
host: "%ldap_host%"
bind_dn: "%ldap_bind_dn%"
bind_password: "%ldap_bind_password%"
user_query:
dn: dc=champs-libres,dc=coop
query: "(&(objectClass=inetOrgPerson)(userPassword=*))"
## Configuration of the security part of chill
Simply add the following config in the firewall of the security bundle :
`chill_ldap_form_login: ~`. This config is located in `app/config/security.yml`
Example of a configuration :
# in app/config/security.yml
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
default:
anonymous: ~
# enable the login check by a form, agaisnt the database
form_login:
csrf_parameter: _csrf_token
csrf_token_id: authenticate
csrf_provider: form.csrf_provider
# enable the login check by a form, against the ldap
chill_ldap_form_login: ~ # this is the line you should add
Note that, if you enable the login check by form **and** by the ldap,
the password will be checked against the database **and** against the ldap.
If one of them match, the login will succeed.
If you want to completely disable login check against the database,
simply remove the `form_login` entry and all his options.
## Command and crontab
Synchronize the database :
php app/console chill:ldap:synchronize
For getting more debug message :
php app/console chill:ldap:synchronize -vvv
You should run this command regularly (using crontab or
`systemd timer ](https://www.freedesktop.org/software/systemd/man/systemd.timer.html#))
to synchronize ldap and database automatically.

View File

@@ -35,34 +35,34 @@ This bundle provides only one entity : :class:`Chill\\LdapBundle\\Entity\\UserLd
How the synchronizer works ?
****************************
#. The synchronizer performs a query on `dn` and `query` defined in the :ref:`configuration <configuration>`.
#. For each entry returned by the query, it looks if the `dn` exists in the database
#. The synchronizer performs a query on :code:`dn` and :code:`query` defined in the :ref:`configuration <configuration>`.
#. For each entry returned by the query, it looks if the :code:`dn` exists in the database
#. If the entry does not exists :
#. the synchronizer looks for user with same username as defined by `username_attr`, and bind it with the `dn` if it exists.
#. else, a user is created with username defined by `username_attr` (if the ldap contains more than one attribute, the first attribute returned is used)
#. the synchronizer looks for user with same username as defined by :code:`username_attr`, and bind it with the :code:`dn` if it exists.
#. else, a user is created with username defined by :code:`username_attr` (if the ldap contains more than one attribute, the first attribute returned is used)
#. if a user exists which is already binded with the `dn`, the entry is ignored.
#. if a user exists which is already binded with the :code:`dn`, the entry is ignored.
#. The synchronizer looks for dn existing in database and which were not returned by the query performed in 1.
#. The synchronizer looks for dn existing in database and which were not returned by the query performed in 1.
#. If they exists, those user are set to `enabled=false`: they are not allowed to login.
#. If they exists, those user are set to :code:`enabled=false`: they are not allowed to login.
Installation
************
This bundle requires :
This bundle requires :
- PHP LDAP ext
- `symfony/ldap` with minimal version 3.1. Note that, currently, Chill uses Symfony 2.8: you should add the dependency on this single package manually
- :code:`symfony/ldap` with minimal version 3.1. Note that, currently, Chill uses Symfony 2.8: you should add the dependency on this single package manually
In your composer.json, for stable version :
In your composer.json, for stable version :
.. code-block:: json
"require": {
// .. other dependencies
// .. other dependencies
"symfony/ldap" : "~3.1",
"chill-project/ldap": "~1.0"
}
@@ -74,7 +74,7 @@ And for dev version :
.. code-block:: json
"require": {
// .. other dependencies
// .. other dependencies
"symfony/ldap" : "~3.1",
"chill-project/ldap": "dev-master@dev"
}
@@ -126,7 +126,7 @@ Configuration of the bundle
username_attr: cn
Example :
Example :
.. code-block:: yaml
@@ -147,7 +147,7 @@ Configuration of the security part of chill
Simply add the following config in the firewall of the security bundle :
`chill_ldap_form_login: ~`. This config is located in `app/config/security.yml`
Example of a configuration :
Example of a configuration :
.. code-block:: yaml
@@ -169,26 +169,26 @@ Example of a configuration :
chill_ldap_form_login: ~ # this is the line you should add
Note that, if you enable the login check by form **and** by the ldap,
Note that, if you enable the login check by form **and** by the ldap,
the password will be checked against the database **and** against the ldap.
If one of them match, the login will succeed.
If you want to completely disable login check against the database,
simply remove the `form_login` entry and all his options.
If you want to completely disable login check against the database,
simply remove the :code:`form_login` entry and all his options.
.. _command-and-crontab:
Command and crontab
===================
Synchronize the database :
Synchronize the database :
.. code-block:: bash
php app/console chill:ldap:synchronize
For getting more debug message :
For getting more debug message :
.. code-block:: bash
@@ -196,7 +196,7 @@ For getting more debug message :
You should run this command regularly (using crontab or
You should run this command regularly (using crontab or
`systemd timer <https://www.freedesktop.org/software/systemd/man/systemd.timer.html#>`_)
to synchronize ldap and database automatically.

View File

@@ -1,38 +0,0 @@
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".
# Main bundle
This bundle is **required** for running Chill.
This bundle provide :
* Access control model (users, groups, and all concepts)
* ...
this section is incomplete.
###### Macros
## Address sticker
Macro file
`ChillMainBundle:Address:macro.html.twig`
Macro name
`_render`
Macro envelope
`address`, instance of :class:`Chill\MainBundle\Entity\Address`
When to use this macro ?
When you want to represent an address.
Example usage :
```jinja
{% import 'ChillMainBundle:Address:macro.html.twig' as m %}
{{ m._render(address) }}
```

View File

@@ -7,7 +7,7 @@
Free Documentation License".
.. _main-bundle:
Main bundle
###########
@@ -34,9 +34,9 @@ Address sticker
Macro file
`ChillMainBundle:Address:macro.html.twig`
Macro name
`_render`
:code:`_render`
Macro envelope
`address`, instance of :class:`Chill\MainBundle\Entity\Address`
:code:`address`, instance of :class:`Chill\MainBundle\Entity\Address`
When to use this macro ?
When you want to represent an address.

View File

@@ -1,196 +0,0 @@
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".
# Person bundle
This bundle provides the ability to record people in the software. This bundle is required by other bundle.
:local:
###### Entities provided
describe entities provided by person bundle
###### Search terms
The class [Chill\PersonBundle\Search\PersonSearch` provide the search module.
## Domain
The search upon "person" is provided by default. The `@person` domain search may be omitted.
* `@person` is the domain search for people.
## Arguments
* `firstname` : provide the search on firstname. Example : `firstname:Depardieu`. May match part of the firstname (`firsname:dep` will match Depardieu)
* `lastname` : provide the search on lastname. May match part of the lastname.
* `birthdate` : provide the search on the birthdate. Example : `birthdate:1996-01-19`
* `gender`: performs search on man/woman. The accepted values are `man` or `woman`.
* `nationality` : performs search on nationality. Value must be a country code `as described in ISO 3166 ](http://www.iso.org/iso/fr/home/standards/country_codes.htm). Example : [nationality:FR`.
## Default
The default search is performed on firstname and/or lastname. Both are concatened before search. If values are separated by spaces, the clause `AND` is used : the search `dep ge` will match 'Gérard Depardieu` or 'Jean Depagelles', but not 'Charline Depardieu' (missing 'Ge' in word).
###### Configuration options
Those options are available under `chill_person` key.
Example of configuration:
chill_person:
validation:
birthdate_not_after: P15Y
person_fields:
# note: visible is the default config. This key may be omitted if visible is chosen.
nationality: hidden
email: hidden
place_of_birth: visible
phonenumber: hidden
country_of_birth: hidden
marital_status: visible
spoken_languages: hidden
address: visible
birthdate_not_after *string*
The period duration before today during which encoding birthdate is not possible. The period is a string matching the format of `ISO_8601`, which is also use to build `DateInterval classes ](http://php.net/manual/en/dateinterval.construct.php).
Example: [P1D`, `P18Y`
Default value: `P1D` which means that birthdate before the current day (= yesterday) are allowed.
person_fields *array*
This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are :
* `nationality`
* `country_of_birth`
* `place_of_birth`
* `phonenumber`
* `email`
* `marital_status`
* `spoken_languages`
* `address`
Possibles values: `hidden` or `visible` (all other value will raise an Exception).
Default value : `visible`, which means that all fields are visible.
Example:
```yaml
chill_person:
person_fields:
nationality: hidden
email: hidden
phonenumber: hidden
```
If all the field of a "box" are hidden, the whole box does not appears. Example: if the fields `phonenumber` and `email` are hidden, the title `Contact information` will be hidden in the UI.
If you hide multiple fields, for a better integration you may want to override the template, for a better appeareance. See `the symfony documentation ](http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates) about this feature.
###### Macros
## Sticker for a person
Macro file
`ChillPersonBundle:Person:macro.html.twig`
Macro envelope
`render(p, withLink=false)`
`p` is an instance of :class:`Chill\PersonBundle\Entity\Person`
`withLink` :class:`boolean`
When to use this macro ?
When you want to represent a person.
Example usage :
```jinja
{% import "ChillPersonBundle:Person:macro.html.twig" as person_ %}
{{ person_.render(person, true) }}
```
###### Layout events and delegated blocks
## `chill_block.person_post_vertical_menu` event
This event is available to add content below of the vertical menu (on the right).
The context is :
- `person` : the current person which is rendered. Instance of :class:`Chill\PersonBundle\Entity\Person`
###### Widgets
## Add a list of person on homepage
The bundle provide a way to add a list of accompanyied person on the homepage:
chill_main:
widgets:
homepage:
-
order: 10
widget_alias: person_list
person_list:
# customize the number of items
number_of_items: 20
# only active
only_active: true
# you can add some filtering class, which will implements
# Chill\PersonBundle\PersonListWidget\PersonFilteringInterface
filtering_class: "\Hepc\HomepagePersonFiltering"
# when the view is overriden, you can add some custom fields
# to the view
custom_fields: [school-2fb5440e-192c-11e6-b2fd-74d02b0c9b55]
###### Commands
## `chill:person:move`
Usage:
chill:person:move [options]
Options:
-f, --from=FROM The person id to delete, all associated data will be moved before
-t, --to=TO The person id which will received data
--dump-sql dump sql to stdout
--force execute sql instead of dumping it
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-e, --env=ENV The Environment name. [default: "dev"]
--no-debug Switches off debug mode.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
Move all the associated entities on a "from" person to a "to" person and remove the old person
Move all the entities associated to a person onto another one, and remove the old person.
Some entities are ignored and will be deleted:
- the accompanying periods ;
- the data attached to a person entity: name, address, date of birth, etc. Thos should be merge before the move.
It is advised to run first the command with the `dump-sql` option and, then, use the `force` option.
The moving and suppression is executed inside a transaction, ensuring no data loss if the migration fails.
Using bash and awk, it is easy to use a TSV file (values separated by a tab, not a comma) to create move commands. Assuming our file is named `twins.tsv` and contains two columns: the first one with `from` ids, and the second one with `to` ids:
```bash
awk '{ print "php app/console chill:person:move --dump-sql --from " $1 " --to " $2;}' twins.tsv
```

View File

@@ -22,8 +22,8 @@ Entities provided
.. todo::
describe entities provided by person bundle
Search terms
************
@@ -82,8 +82,8 @@ birthdate_not_after *string*
Default value: `P1D` which means that birthdate before the current day (= yesterday) are allowed.
person_fields *array*
This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are :
This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are :
* `nationality`
* `country_of_birth`
* `place_of_birth`
@@ -97,7 +97,7 @@ person_fields *array*
Default value : `visible`, which means that all fields are visible.
Example:
Example:
.. code-block:: yaml
@@ -107,10 +107,10 @@ person_fields *array*
email: hidden
phonenumber: hidden
.. note::
.. note::
If all the field of a "box" are hidden, the whole box does not appears. Example: if the fields `phonenumber` and `email` are hidden, the title `Contact information` will be hidden in the UI.
.. note::
.. note::
If you hide multiple fields, for a better integration you may want to override the template, for a better appeareance. See `the symfony documentation <http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates>`_ about this feature.
.. _person-bundle-macros:
@@ -124,11 +124,11 @@ Sticker for a person
Macro file
`ChillPersonBundle:Person:macro.html.twig`
Macro envelope
`render(p, withLink=false)`
:code:`render(p, withLink=false)`
`p` is an instance of :class:`Chill\PersonBundle\Entity\Person`
:code:`p` is an instance of :class:`Chill\PersonBundle\Entity\Person`
`withLink` :class:`boolean`
:code:`withLink` :class:`boolean`
When to use this macro ?
When you want to represent a person.
Example usage :
@@ -141,14 +141,14 @@ Example usage :
Layout events and delegated blocks
***********************************
`chill_block.person_post_vertical_menu` event
:code:`chill_block.person_post_vertical_menu` event
====================================================
This event is available to add content below of the vertical menu (on the right).
The context is :
The context is :
- `person` : the current person which is rendered. Instance of :class:`Chill\PersonBundle\Entity\Person`
- :code:`person` : the current person which is rendered. Instance of :class:`Chill\PersonBundle\Entity\Person`
Widgets
*******
@@ -162,8 +162,8 @@ The bundle provide a way to add a list of accompanyied person on the homepage:
chill_main:
widgets:
homepage:
-
homepage:
-
order: 10
widget_alias: person_list
person_list:
@@ -180,12 +180,12 @@ The bundle provide a way to add a list of accompanyied person on the homepage:
# when the view is overriden, you can add some custom fields
# to the view
custom_fields: [school-2fb5440e-192c-11e6-b2fd-74d02b0c9b55]
Commands
********
`chill:person:move`
:code:`chill:person:move`
=========================
.. code-block:: txt
@@ -213,21 +213,21 @@ Commands
Move all the entities associated to a person onto another one, and remove the old person.
.. warning::
.. warning::
Some entities are ignored and will be deleted:
Some entities are ignored and will be deleted:
- the accompanying periods ;
- the data attached to a person entity: name, address, date of birth, etc. Thos should be merge before the move.
It is advised to run first the command with the `dump-sql` option and, then, use the `force` option.
It is advised to run first the command with the :code:`dump-sql` option and, then, use the :code:`force` option.
The moving and suppression is executed inside a transaction, ensuring no data loss if the migration fails.
.. note::
Using bash and awk, it is easy to use a TSV file (values separated by a tab, not a comma) to create move commands. Assuming our file is named `twins.tsv` and contains two columns: the first one with `from` ids, and the second one with `to` ids:
Using bash and awk, it is easy to use a TSV file (values separated by a tab, not a comma) to create move commands. Assuming our file is named :code:`twins.tsv` and contains two columns: the first one with :code:`from` ids, and the second one with :code:`to` ids:
.. code-block:: bash
awk '{ print "php app/console chill:person:move --dump-sql --from " $1 " --to " $2;}' twins.tsv
awk '{ print "php app/console chill:person:move --dump-sql --from " $1 " --to " $2;}' twins.tsv

View File

@@ -1,32 +0,0 @@
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".
# Report bundle
This bundle provides the ability to record report about people. We use custom fields to let user add fields to reports.
:local:
The documentation about report is not writtend
## Concepts
## Search
### Domain
* `@report` is the domain search for reports.
### Arguments
* `date` : The date of the report
### Default
The report's date is the default value.
An error is thrown if an argument `date` and a default is used.

View File

@@ -1,23 +0,0 @@
# Frequently asked questions
## Continuous integration
Pipeline fails, but php-cs-fixer doesn't alert me when running it locally?
========================================
It is possible that you run php-cs-fixer on your local instance of chill and no fixes are made.
Everything seems fine, so you push. However, once the pipeline is run in gitlab, you're notified that it failed due to php
cs errors.
In this case it's likely that you have to update your version of php-cs-fixer.
php-cs-fixer is installed when building the docker image: https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/src/branch/main/Dockerfile#L50
Consequently, to update php-cs-fixer, we have to update the image by building it again.
For this the following commands can be used.
```
docker compose build --pull php
# replace existing containers
docker compose up -d --force-recreate php
```

View File

@@ -0,0 +1,36 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
.. _faq:
Frequently asked questions
####################
Continuous integration
***********
Pipeline fails, but php-cs-fixer doesn't alert me when running it locally ?
========================================
It is possible that you run php-cs-fixer on your local instance of chill and no fixes are made.
Everything seems fine, so you push. However once the pipeline is run in gitlab, you're notified that it failed due to php
cs errors.
In this case it's likely that you have to update your version of php-cs-fixer.
php-cs-fixer is installed when building the docker image: https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/src/branch/main/Dockerfile#L50
Consequently, to update php-cs-fixer we have to update the image by building it again.
For this the following commands can be used,
.. code-block:: php
docker compose build --pull php
# replace existing containers
docker compose up -d --force-recreate php

View File

@@ -1,15 +1,19 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2015 Champs Libres Cooperative SCRLFS
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".
###### Access controle model
Access controle model
**********************
.. contents:: Table of content
:local:
## Concepts
Concepts
========
Every time an entity is created, viewed or updated, the software check if the user has the permission to make this action. The decision is made with three parameters :
@@ -19,15 +23,20 @@ Every time an entity is created, viewed or updated, the software check if the us
The user must be granted access to the action on this particular entity, with this scope and center.
## TL;DR
TL;DR
=====
### Resolve scope and center
Resolve scope and center
------------------------
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
@@ -49,6 +58,8 @@ In a service, resolve the center and scope of an entity
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
@@ -70,6 +81,8 @@ In twig template, resolve the center:
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
@@ -85,7 +98,10 @@ In twig template, resolve the scope:
{% endfor %}
{%- endif -%}
### Build a ``Voter``
Build a ``Voter``
-----------------
.. code-block:: php
<?php
@@ -135,6 +151,7 @@ In twig template, resolve the scope:
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
@@ -177,19 +194,25 @@ In twig template, resolve the scope:
return array();
}
public function getRolesWithHierarchy()
{
return ['PersonDocument' => $this->getRoles() ];
}
}
## From an user point of view
From an user point of view
==========================
The software is design to allow fine tuned access rights for complicated installation and team structure. The administrators may also decide that every user has the right to see all resources, where team have a more simple structure.
Here is an overview of the model.
### Chill can be multi-center
Chill can be multi-center
-------------------------
Chill is designed to be installed once for social center who work with multiple teams separated, or for social services's federation who would like to share the same installation of the software for all their members.
@@ -199,7 +222,8 @@ Otherwise, it is not required to create multiple center: Chill can also work for
Obviously, users working in the different centers are not allowed to see the entities (_persons_, _reports_, _activities_) of other centers. But users may be attached to multiple centers: consequently they will be able to see the entities of the multiple centers they are attached to.
### Inside center, scope divide team
Inside center, scope divide team
--------------------------------
Users are attached to one or more center and, inside to those center, there may exists differents scopes. The aim of those _scopes_ is to divide the whole team of social worker amongst different departement, for instance: the social team, the psychologist team, the nurse team, the administrative team, ... Each team is granted of different rights amongst scope. For instance, the social team may not see the _activities_ of the psychologist team. The administrative team may see the date & time's activities, but is not allowed to see the detail of those entities (the personal notes, ...).
@@ -209,7 +233,9 @@ As entities have only one scopes, if some entities must be shared across two dif
Example: if some activities must be seen and updated between nurses and psychologists, the administrator will create a scope "nurse and psy" and add the ability for both team "nurse" and "psychologist" to "create", "see", and "update" the activities belonging to scope "nurse and psy".
## Where does the [`scope`` and ``center`` comes from ?
Where does the ``scope`` and ``center`` comes from ?
====================================================
Most often, scope and center comes from user's input:
@@ -230,23 +256,30 @@ But sometimes, this implementation does not fits the needs:
For this reasons, associated center and scopes must be resolved programmatically. The default implementation rely on the model association, as described above. But it becomes possible to change the behaviour on different implementations.
### Is my entity "concerned" by scopes ?
Is my entity "concerned" by scopes ?
------------------------------------
Some entities are concerned by scope, some not.
This is also programmatically resolved.
## The concepts translated into code
The concepts translated into code
===================================
.. figure:: /_static/access_control_model.png
Schema of the access control model
Chill handle **entities**, like *persons*, *reports* (associated to *persons*), *activities* (also associated to *_persons*), ... On creation, those entities are linked to one center and, eventually, to one scope. They implements the interface `HasCenterInterface`.
.. note::
Somes entities are linked to a center through the entity they are associated with. For instance, *activities* or *reports* are associated to a *person*, and the person is associated to a *center*. The *report*'s *center* is always the *person*'s *center*.
Entities may be associated with a scope. In this case, they implement the `HasScopeInterface`.
.. note::
Currently, only the *person* entity is not associated with a scope.
At each step of his lifetime (creation, view of the entity and eventually of his details, update and, eventually, deletion), the right of the user are checked. To decide wether the user is granted right to execute the action, the software must decide with those elements :
@@ -258,10 +291,13 @@ At each step of his lifetime (creation, view of the entity and eventually of his
All those action are executed through symfony voters and helpers.
## How to check authorization ?
How to check authorization ?
============================
Just use the symfony way-of-doing, but do not forget to associate the entity you want to check access. For instance, in controller :
.. code-block:: php
class MyController extends Controller
{
@@ -275,9 +311,12 @@ Just use the symfony way-of-doing, but do not forget to associate the entity you
And in template :
.. code-block:: twig
{{ if is_granted('CHILL_ENTITY_SEE', entity) %}print something{% endif %}
### Retrieving reachable scopes and centers for a user
Retrieving reachable scopes and centers for a user
--------------------------------------------------
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelperInterface` helps you to get centers and scope reachable by a user.
@@ -286,7 +325,9 @@ Those methods are intentionnaly build to give information about user rights:
- getReachableCenters: to get reachable centers for a user
- getReachableScopes : to get reachable scopes for a user
### Adding your own roles
Adding your own roles
---------------------
Extending Chill will requires you to define your own roles and rules for your entities. You will have to define your own voter to do so.
@@ -295,20 +336,28 @@ To create your own roles, you should:
* implement your own voter. This voter will have to extends the :class:`Chill\\MainBundle\\Security\\AbstractChillVoter`. As defined by Symfony, this voter must be declared as a service and tagged with `security.voter`;
* declare the role through implementing a service tagged with `chill.role` and implementing :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`.
.. note::
Both operation may be done through a simple class: you can implements :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface` and :class:`Chill\\MainBundle\\Security\\AbstractChillVoter` on the same class. See live example: :class:`Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter`, and similar examples in the `PersonBundle` and `ReportBundle`.
`How to Use Voters to Check User Permissions ](http://symfony.com/doc/current/cookbook/security/voters_data_permission.html)
.. seealso::
`How to Use Voters to Check User Permissions <http://symfony.com/doc/current/cookbook/security/voters_data_permission.html>`_
From the symfony cookbook
[New in Symfony 2.6: Simpler Security Voters ](http://symfony.com/blog/new-in-symfony-2-6-simpler-security-voters)
`New in Symfony 2.6: Simpler Security Voters <http://symfony.com/blog/new-in-symfony-2-6-simpler-security-voters>`_
From the symfony blog
##### Declare your role
Declare your role
^^^^^^^^^^^^^^^^^^
To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`.
.. code-block:: php
interface ProvideRoleInterface
{
/**
@@ -326,15 +375,21 @@ To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\Pr
public function getRolesWithoutScope();
}
Then declare your service with a tag `chill.role`. Example :
.. code-block:: yaml
your_service:
class: Chill\YourBundle\Security\Authorization\YourVoter
tags:
- { name: chill.role }
Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`:
.. code-block:: php
namespace Chill\PersonBundle\Security\Authorization;
use Chill\MainBundle\Security\ProvideRoleInterface;
@@ -357,10 +412,13 @@ Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRole
}
##### Adding role hierarchy
Adding role hierarchy
^^^^^^^^^^^^^^^^^^^^^
You should prepend Symfony's security component directly from your code.
.. code-block:: php
namespace Chill\ReportBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
@@ -392,7 +450,10 @@ You should prepend Symfony's security component directly from your code.
}
}
##### Implement your voter
Implement your voter
^^^^^^^^^^^^^^^^^^^^
Most of the time, Voter will check that:
@@ -403,6 +464,7 @@ Most of the time, Voter will check that:
Thats what we call the "autorization logic". But this logic may be replace by a new one, and developers should take care of it.
Then voter implementation should take care of:
* check the access to associated entities. For instance, if an ``Activity`` is associated to a ``Person``, the voter should first check that the user can show the associated ``Person``;
@@ -410,6 +472,9 @@ Then voter implementation should take care of:
This is an example of implementation:
.. code-block:: php
<?php
namespace Chill\DocStoreBundle\Security\Authorization;
@@ -448,6 +513,7 @@ This is an example of implementation:
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
@@ -487,6 +553,7 @@ This is an example of implementation:
// ...
}
public function getRolesWithHierarchy()
{
// ...
@@ -495,6 +562,8 @@ This is an example of implementation:
Then, you will have to declare the service and tag it as a voter :
.. code-block:: yaml
services:
chill.report.security.authorization.report_voter:
class: Chill\ReportBundle\Security\Authorization\ReportVoter
@@ -503,13 +572,18 @@ Then, you will have to declare the service and tag it as a voter :
tags:
- { name: security.voter }
## How to resolve scope and center programmatically ?
How to resolve scope and center programmatically ?
==================================================
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
@@ -531,6 +605,8 @@ In a service, resolve the center and scope of an entity
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
@@ -552,6 +628,8 @@ In twig template, resolve the center:
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
@@ -567,7 +645,8 @@ In twig template, resolve the scope:
{% endfor %}
{%- endif -%}
### What is the default implementation of Scope and Center resolver ?
What is the default implementation of Scope and Center resolver ?
-----------------------------------------------------------------
By default, the implementation rely on association into entities.
@@ -578,14 +657,16 @@ By default, the implementation rely on association into entities.
Then, the default implementation will resolve the center and scope based on the implementation in your model.
### How to change the default behaviour ?
How to change the default behaviour ?
-------------------------------------
Implements those interface into services:
* ``Chill\MainBundle\Security\Resolver\CenterResolverInterface``;
* ``Chill\MainBundle\Security\Resolver\ScopeResolverInterface``;
## Authorization into lists and index pages
Authorization into lists and index pages
========================================
Due to the fact that authorization model may be overriden, "list" and "index" pages should not rely on center and scope from controller. This must be delegated to dedicated service, which will be aware of the authorization model. We call them ``ACLAwareRepository``. This service must implements an interface, in order to allow to change the implementation.
@@ -593,11 +674,14 @@ The controller **must not** performs any DQL or SQL query.
Example in a controller:
.. code-block:: php
namespace Chill\TaskBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface;
final class SingleTaskController extends AbstractController
{
@@ -645,9 +729,11 @@ Example in a controller:
}
}
### Writing ``ACLAwareRepository``
Writing ``ACLAwareRepository``
------------------------------
##### The ACLAwareRepository should rely on interfaces
The ACLAwareRepository should rely on interfaces
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As described above, the ACLAwareRepository will perform the query for listing entities, and take care of authorization.
@@ -657,6 +743,9 @@ The service must rely on this interface, and not on the default implementation.
Example: at first, we design an interface for listing ``SingleTask`` entities:
.. code-block:: php
<?php
namespace Chill\TaskBundle\Repository;
@@ -693,6 +782,8 @@ Example: at first, we design an interface for listing ``SingleTask`` entities:
Implements this interface and register the interface as an alias for the implementation.
.. code-block:: yaml
services:
Chill\TaskBundle\Repository\SingleTaskAclAwareRepository:
autowire: true
@@ -700,7 +791,8 @@ Implements this interface and register the interface as an alias for the impleme
Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface: '@Chill\TaskBundle\Repository\SingleTaskAclAwareRepository'
##### Write the basic implementation for re-use: separate authorization logic and search logic
Write the basic implementation for re-use: separate authorization logic and search logic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The logic of such repository may be separated into two logic:
@@ -711,6 +803,8 @@ This logic should be separated into your implementation.
Considering this simple interface:
.. code-block:: php
interface MyEntityACLAwareRepositoryInterface {
public function countByAuthorized(array $criterias): int;
@@ -721,11 +815,15 @@ Considering this simple interface:
The base implementation should separate the logic to allow an easy reuse. Here, the method ``buildQuery`` build a basic query without authorization logic, which can be re-used. The authorization logic is dedicated to a private method. For ease of user, the logic of adding ordering criterias and pagination parameters (``$start`` and ``$limit``) are also delegated to a public method.
.. code-block:: php
namespace Chill\MyBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
final class MyEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
@@ -777,12 +875,15 @@ The base implementation should separate the logic to allow an easy reuse. Here,
Once this logic is executed, it becomes easy to make a new implementation of the repository:
.. code-block:: php
namespace Chill\MyOtherBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MyBundle\Repository\MyEntityACLAwareRepository
final class AnotherEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
@@ -820,8 +921,14 @@ Once this logic is executed, it becomes easy to make a new implementation of the
Then, register this service and decorates the old one:
.. code-block:: yaml
services:
Chill\MyOtherBundle\Repository\AnotherEntityACLAwareRepository:
autowire: true
autoconfigure: true
decorates: Chill\MyBundle\Repository\MyEntityACLAwareRepositoryInterface:
decorates: Chill\MyBundle\Repository\MyEntityACLAwareRepositoryInterface:

View File

@@ -1,10 +1,23 @@
# API
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
.. _api:
API
###
Chill provides a basic framework to build REST api.
###### Basic configuration
Basic configuration
*******************
## Configure a route
Configure a route
=================
Follow those steps to build a REST api:
@@ -14,29 +27,36 @@ Follow those steps to build a REST api:
You can also:
* hook into the controller to customize some steps;
* add more routes and steps
* add more route and steps
.. note::
Useful links:
* [How to use annotation to configure serialization ](https://symfony.com/doc/current/serializer.html)
* [How to create your custom normalizer ](https://symfony.com/doc/current/serializer/custom_normalizer.html)
* `How to use annotation to configure serialization <https://symfony.com/doc/current/serializer.html>`_
* `How to create your custom normalizer <https://symfony.com/doc/current/serializer/custom_normalizer.html>`_
## Autoloading the routes
Auto-loading the routes
=======================
Ensure that those lines are present in your file `app/config/routing.yml`:
```yaml
.. code-block:: yaml
chill_cruds:
resource: 'chill_main_crud_route_loader:load'
type: service
```
## Create your model
Create your model in the usual way:
Create your model
=================
```php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
Create your model on the usual way:
.. code-block:: php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod\OriginRepository;
use Doctrine\ORM\Mapping as ORM;
@@ -67,14 +87,16 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
// .. getters and setters
}
```
## Configure api
Configure the api using YAML (see the full configuration: [api_full_configuration](api_full_configuration.md)):
Configure api
=============
```yaml
# config/packages/chill_main.yaml
Configure the api using Yaml (see the full configuration: :ref:`api_full_configuration`):
.. code-block:: yaml
# config/packages/chill_main.yaml
chill_main:
apis:
accompanying_period_origin:
@@ -91,13 +113,15 @@ Configure the api using YAML (see the full configuration: [api_full_configuratio
methods:
GET: true
HEAD: true
```
If you are working on a shared bundle (aka "The chill bundles"), you should define your configuration inside the class `ChillXXXXBundleExtension`, using the "prependConfig" feature:
```php
.. note::
If you are working on a shared bundle (aka "The chill bundles"), you should define your configuration inside the class :code:`ChillXXXXBundleExtension`, using the "prependConfig" feature:
.. code-block:: php
namespace Chill\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -131,13 +155,13 @@ Configure the api using YAML (see the full configuration: [api_full_configuratio
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
'methods' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true
],
],
'_entity' => [
'methods' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true
]
@@ -148,35 +172,37 @@ Configure the api using YAML (see the full configuration: [api_full_configuratio
]);
}
}
```
###### The `_index` and `_entity` action
The :code:`_index` and :code:`_entity` action
*********************************************
The `_index` and `_entity` action are default actions:
The :code:`_index` and :code:`_entity` action are default actions:
* they will call a specific method in the default controller;
* they will generate defined routes:
Index:
Name: `chill_api_single_accompanying_period_origin__index`
Name: :code:`chill_api_single_accompanying_period_origin__index`
Path: `/api/1.0/person/accompanying-period/origin.{_format}`
Path: :code:`/api/1.0/person/accompanying-period/origin.{_format}`
Entity:
Name: `chill_api_single_accompanying_period_origin__entity`
Name: :code:`chill_api_single_accompanying_period_origin__entity`
Path: `/api/1.0/person/accompanying-period/origin/{id}.{_format}`
Path: :code:`/api/1.0/person/accompanying-period/origin/{id}.{_format}`
###### Role
Role
****
By default, the key `base_role` is used to check ACL. Take care of creating the `Voter` required to take that into account.
By default, the key `base_role` is used to check ACL. Take care of creating the :code:`Voter` required to take that into account.
For index action, the role will be called with `NULL` as `$subject`. The retrieved entity will be the subject for single queries.
For index action, the role will be called with :code:`NULL` as :code:`$subject`. The retrieved entity will be the subject for single queries.
You can also define a role for each method. In this case, this role is used for the given method, and, if any, the base role is taken into account.
```yaml
# config/packages/chill_main.yaml
.. code-block:: yaml
# config/packages/chill_main.yaml
chill_main:
apis:
accompanying_period_origin:
@@ -191,13 +217,16 @@ You can also define a role for each method. In this case, this role is used for
roles:
GET: MY_ROLE_SEE
HEAD: MY ROLE_SEE
```
###### Customize the controller
Customize the controller
************************
You can customize the controller by hooking into the default actions. Take care of extending :code:`Chill\MainBundle\CRUD\Controller\ApiController`.
.. code-block:: php
You can customize the controller by hooking into the default actions. Take care of extending `Chill\MainBundle\CRUD\Controller\ApiController`.
```php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
@@ -211,14 +240,14 @@ You can customize the controller by hooking into the default actions. Take care
$qb->where($qb->expr()->gt('e.noActiveAfter', ':now'))
->orWhere($qb->expr()->isNull('e.noActiveAfter'));
$qb->setParameter('now', new \DateTime('now'));
}
}
}
```
And set your controller in configuration:
```yaml
chill_main:
.. code-block:: yaml
chill_main:
apis:
accompanying_period_origin:
base_path: '/api/1.0/person/accompanying-period/origin'
@@ -236,15 +265,15 @@ And set your controller in configuration:
methods:
GET: true
HEAD: true
```
###### Create your own actions
Create your own actions
***********************
You can add your own actions:
```yaml
.. code-block:: yaml
chill_main:
chill_main:
apis:
-
class: Chill\PersonBundle\Entity\AccompanyingPeriod
@@ -252,7 +281,7 @@ chill_main:
base_path: /api/1.0/person/accompanying-course
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
actions:
# add custom participation:
# add a custom participation:
participation:
methods:
POST: true
@@ -267,13 +296,13 @@ chill_main:
HEAD: null
PUT: null
single-collection: single
```
The key `single-collection` with value `single` will add a `/{id}/ + "action name"` (in this example, `/{id}/participation`) into the path, after the base path. If the value is `collection`, no id will be set, but the action name will be append to the path.
The key :code:`single-collection` with value :code:`single` will add a :code:`/{id}/ + "action name"` (in this example, :code:`/{id}/participation`) into the path, after the base path. If the value is :code:`collection`, no id will be set, but the action name will be append to the path.
Then, create the corresponding action into your controller:
```php
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
@@ -297,10 +326,10 @@ Then, create the corresponding action into your controller:
$this->eventDispatcher = $eventDispatcher;
$this->validator = $validator;
}
public function participationApi($id, Request $request, $_format)
{
/** @var AccompanyingPeriod $accompanyingPeriod */
/** @var AccompanyingPeriod $accompanyingPeriod */
$accompanyingPeriod = $this->getEntity('participation', $id, $request);
$person = $this->getSerializer()
->deserialize($request->getContent(), Person::class, $_format, []);
@@ -334,18 +363,20 @@ Then, create the corresponding action into your controller:
return $this->json($participation);
}
}
```
###### Managing association
Managing association
********************
## ManyToOne association
ManyToOne association
=====================
In ManyToOne association, you can add associated entities using the `PATCH` request. By default, the serializer deserialize entities only with their id and discriminator type, if any.
In ManyToOne association, you can add associated entities using the :code:`PATCH` request. By default, the serializer deserialize entities only with their id and discriminator type, if any.
Example:
```
curl -X 'PATCH' \
.. code-block:: bash
curl -X 'PATCH' \
'http://localhost:8001/api/1.0/person/accompanying-course/2668.json' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
@@ -355,15 +386,16 @@ curl -X 'PATCH' \
"id": 2668,
"origin": { "id": 11 }
}'
```
## ManyToMany associations
ManyToMany associations
=======================
In OneToMany association, you can easily create route for adding and removing entities, using `POST` and `DELETE` requests.
In OneToMany association, you can easily create route for adding and removing entities, using :code:`POST` and :code:`DELETE` requests.
Prepare your entity, creating the methods `addYourEntity` and `removeYourEntity`:
Prepare your entity, creating the methods :code:`addYourEntity` and :code:`removeYourEntity`:
.. code-block:: php
```php
namespace Chill\PersonBundle\Entity;
use Chill\MainBundle\Entity\Scope;
@@ -405,12 +437,12 @@ Prepare your entity, creating the methods `addYourEntity` and `removeYourEntity`
{
$this->scopes->removeElement($scope);
}
```
Create your route into the configuration:
```yaml
# config/packages/chill_main.yaml`
.. code-block:: yaml
chill_main:
apis:
-
@@ -437,12 +469,14 @@ Create your route into the configuration:
controller_action: null
path: null
single-collection: single
```
This will create a new route, which will accept two methods: DELETE and POST:
.. code-block:: raw
+--------------+---------------------------------------------------------------------------------------+
| Property | Value |
+--------------+---------------------------------------------------------------------------------------+
| Route Name | chill_api_single_accompanying_course_scope |
| Path | /api/1.0/person/accompanying-course/{id}/scope.{_format} |
| Path Regex | {^/api/1\.0/person/accompanying\-course/(?P<id>[^/]++)/scope\.(?P<_format>[^/]++)$}sD |
@@ -454,10 +488,14 @@ This will create a new route, which will accept two methods: DELETE and POST:
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: csapi_accompanying_course_controller:scopeApi |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
+--------------+---------------------------------------------------------------------------------------+
Then, create the controller action. Call the method:
```php
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
@@ -472,14 +510,14 @@ Then, create the controller action. Call the method:
return $this->addRemoveSomething('scope', $id, $request, $_format, 'scope', Scope::class, [ 'groups' => [ 'read' ] ]);
}
}
```
This will allow adding a scope by his id and deleting them.
This will allow to add a scope by his id, and delete them.
Curl requests:
```
# add a scope with id 5
.. code-block:: bash
# add a scope with id 5
curl -X 'POST' \
'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \
-H 'accept: */*' \
@@ -498,13 +536,14 @@ Curl requests:
"id": 5,
"type": "scope"
}'
```
## Deserializing an association where multiple types are allowed
Deserializing an association where multiple types are allowed
=============================================================
Sometimes, multiple types are allowed as association to one entity:
Sometimes, multiples types are allowed as association to one entity:
.. code-block:: php
```php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
@@ -514,6 +553,7 @@ Sometimes, multiple types are allowed as association to one entity:
class Resource
{
/**
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
* @ORM\JoinColumn(nullable=true)
@@ -526,6 +566,7 @@ Sometimes, multiple types are allowed as association to one entity:
*/
private $person;
/**
*
* @param $resource Person|ThirdParty
@@ -534,8 +575,8 @@ Sometimes, multiple types are allowed as association to one entity:
{
// ...
}
/**
* @return ThirdParty|Person
* @Groups({"read", "write"})
@@ -545,13 +586,13 @@ Sometimes, multiple types are allowed as association to one entity:
return $this->person ?? $this->thirdParty;
}
}
```
This is not well taken into account by the Symfony serializer natively.
You must, then, create your own CustomNormalizer. You can help yourself using this:
```php
.. code-block:: php
namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\PersonBundle\Entity\Person;
@@ -565,6 +606,7 @@ You must, then, create your own CustomNormalizer. You can help yourself using th
use Symfony\Component\Serializer\Exception;
use Chill\MainBundle\Serializer\Normalizer\DiscriminatedObjectDenormalizer;
class AccompanyingPeriodResourceNormalizer implements DenormalizerInterface, DenormalizerAwareInterface
{
use DenormalizerAwareTrait;
@@ -590,34 +632,35 @@ You must, then, create your own CustomNormalizer. You can help yourself using th
DiscriminatedObjectDenormalizer::TYPE,
$format,
// into the context, we add the list of allowed types:
[
DiscriminatedObjectDenormalizer::ALLOWED_TYPES =>
[
[
DiscriminatedObjectDenormalizer::ALLOWED_TYPES =>
[
Person::class, ThirdParty::class
]
]
);
$resource->setResource($res);
}
}
return $resource;
}
public function supportsDenormalization($data, string $type, string $format = null)
{
return $type === Resource::class;
}
}
}
```
###### Serialization for collection
Serialization for collection
****************************
A specific model has been defined for returning collection:
```
{
.. code-block:: json
{
"count": 49,
"results": [
],
@@ -629,13 +672,13 @@ A specific model has been defined for returning collection:
"items_per_page": 1
}
}
```
Where this is relevant, this model should be re-used in custom controller actions.
In custom actions, this can be achieved quickly by assembling results into a `Chill\MainBundle\Serializer\Model\Collection`. The pagination information is given by using `Paginator` (see [Pagination ](pagination-ref.md)).
In custom actions, this can be achieved quickly by assembling results into a :code:`Chill\MainBundle\Serializer\Model\Collection`. The pagination information is given by using :code:`Paginator` (see :ref:`Pagination <pagination-ref>`).
.. code-block:: php
```php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\MainBundle\Pagination\PaginatorInterface;
@@ -649,11 +692,15 @@ In custom actions, this can be achieved quickly by assembling results into a `Ch
return $this->json($model, Response::HTTP_OK, [], $context);
}
}
```
###### Full configuration example
```yaml
.. _api_full_configuration:
Full configuration example
**************************
.. code-block:: yaml
apis:
-
class: Chill\PersonBundle\Entity\AccompanyingPeriod
@@ -696,4 +743,5 @@ In custom actions, this can be achieved quickly by assembling results into a `Ch
path: null
single-collection: single
base_role: null
```

View File

@@ -1,61 +1,91 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
# Assets
.. _forms:
Assets
#######
The Chill assets (js, css, images, …) can be managed by `Webpack Encore`_, which is a thin wrapper for `Webpack`_ in Symfony applications.
###### Installation
Installation
************
Webpack Encore needs to be run in a Node.js environment, using the Yarn package manager. This Node.js environment can be set up using a node docker image. The bash script `docker-node.sh` set up a Node.js environment with an adequate configuration. Launch this container by typing:
.. code-block:: bash
$ bash docker-node.sh
In this NodeJS environment, install all the assets required by Chill with:
.. code-block:: bash
node@b91cab4f7cfc:/app$ yarn install
This command will install all the packages that are listed in `package.json`.
Any further required dependencies can be installed using the Yarn package. For instance, jQuery is installed by:
.. code-block:: bash
node@b91cab4f7cfc:/app$ yarn add jquery --dev
###### Usage
### Organize your assets
Usage
*****
Organize your assets
--------------------
Chill assets usually lives under the `/Resources/public` folder of each Chill bundle. The Webpack configuration set up in `webpack.config.js` automatically loads the required assets from the Chill bundles that are used.
For adding your own assets to Webpack, you must add an entry in the `webpack.config.js` file. For instance, the following entry will output a file `main.js` collecting the js code (and possibly css, image, etc.) from `./assets/main.js`.
.. code-block:: js
.addEntry('main', './assets/main.js')
To gather the css files, simply connect them to your js file, using `require`. The css file is seen as a dependency of your js file. :
.. code-block:: js
// assets/js/main.js
require('../css/app.css');
For finer configuration of webpack encore, we refer to the above-linked documentation.
### Compile the assets
Compile the assets
------------------
To compile the assets, run this line in the NodeJS container:
.. code-block:: bash
node@b91cab4f7cfc:/app$ yarn run encore dev
While developing, you can tell Webpack Encore to continuously watch the files you are modifying:
.. code-block:: bash
node@b91cab4f7cfc:/app$ yarn run encore dev --watch
### Use the assets in the templates
Use the assets in the templates
--------------------------------
Any entry defined in the webpack.config.js file can be linked to your application using the symfony `asset` helper:
.. code-block:: html
<head>
...
<link rel="stylesheet" href="{{ asset('build/app.css') }}">
@@ -63,4 +93,12 @@ Any entry defined in the webpack.config.js file can be linked to your applicatio
<body>
...
<script src="{{ asset('build/app.js') }}"></script>
</body>
</body>
.. _Webpack Encore: https://www.npmjs.com/package/@symfony/webpack-encore
.. _Webpack: https://webpack.js.org/

View File

@@ -1,23 +0,0 @@
# Code style, code quality and other tools
## PHP-cs-fixer
For development, you will also have to install:
- [php-cs-fixer ](https://cs.symfony.com/)
We also encourage you to use tools like [phpstan ](https://phpstan.org) and [rector ](https://getrector.com).
For running php-cs-fixer:
symfony composer php-cs-fixer
## Execute tests
symfony composer exec phpunit -- /path/to_your_test.php
Note that IDE like PhpStorm should be able to run tests, even KernelTestcase or WebTestCase, [from within their interfaces ](https://www.jetbrains.com/help/phpstorm/using-phpunit-framework.html#run_phpunit_tests).
## Execute rector
symfony composer exec rector -- process

View File

@@ -0,0 +1,34 @@
Code style, code quality and other tools
########################################
PHP-cs-fixer
============
For development, you will also have to install:
- `php-cs-fixer <https://cs.symfony.com/>`_
We also encourage you to use tools like `phpstan <https://phpstan.org>`_ and `rector <https://getrector.com>`_.
For running php-cs-fixer:
.. code-block:: bash
symfony composer php-cs-fixer
Execute tests
=============
.. code-block:: bash
symfony composer exec phpunit -- /path/to_your_test.php
Note that IDE like PhpStorm should be able to run tests, even KernelTestcase or WebTestCase, `from within their interfaces <https://www.jetbrains.com/help/phpstorm/using-phpunit-framework.html#run_phpunit_tests>`_.
Execute rector
==============
.. code-block:: bash
symfony composer exec rector -- process

View File

@@ -1,11 +1,15 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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
*******************
Create your own bundle is not a trivial task.
@@ -15,9 +19,16 @@ The easiest way to achieve this is seems to be :
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)
5. Move to a development installation, made as described in the :ref:`installation-for-development` section, and add your new repository to the composer.json file
6. Work as :ref:`usual <editing-code-and-commiting>`
.. warning::
This part of the doc is not yet tested
TODO
TODO
.. rubric:: Footnotes
.. [#f1] Be aware that we use the Affero GPL Licence, which ensure that all users must have access to derivative works done with this software.

View File

@@ -1,26 +1,37 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2014-2023 Champs Libres Cooperative SCRLFS
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".
###### Cron jobs
.. _cronjob:
Cron jobs
*********
Some tasks must be executed regularly: refresh some materialized views, remove old data, ...
For this purpose, one can programmatically implements a "cron job", which will be scheduled by a specific command.
## The command `chill:cron-job:execute`
The command :code:`chill:cron-job:execute`
==========================================
The command `chill:cron-job:execute` will schedule a task, one by one. In a classical implementation, it should
The command :code:`chill:cron-job:execute` will schedule a task, one by one. In a classical implementation, it should
be executed every 15 minutes (more or less), to ensure that every task can be executed.
.. warning::
This command should not be executed in parallel. The installer should ensure that two job are executed concurrently.
## How to implements a cron job ?
How to implements a cron job ?
==============================
Implements a `Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
.. code-block:: php
namespace Chill\MainBundle\Service\Something;
@@ -72,15 +83,19 @@ Implements a `Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
}
}
## How are cron job scheduled ?
How are cron job scheduled ?
============================
If the command `chill:cron-job:execute` is run with one or more `job` argument, those jobs are run, **without checking that the job can run** (the method `canRun` is not executed).
If the command :code:`chill:cron-job:execute` is run with one or more :code:`job` argument, those jobs are run, **without checking that the job can run** (the method :code:`canRun` is not executed).
If any `job` argument is given, the `CronManager` schedule job with those steps:
If any :code:`job` argument is given, the :code:`CronManager` schedule job with those steps:
* the tasks are ordered, with:
* a priority is given for tasks that weren't never executed;
* then, the tasks are ordered, the last executed are the first in the list
* then, for each tasks, and in the given order, the first task where `canRun` return `TRUE` will be executed.
* then, for each tasks, and in the given order, the first task where :code:`canRun` return :code:`TRUE` will be executed.
The command :code:`chill:cron-job:execute` execute **only one** task.
The command `chill:cron-job:execute` execute **only one** task.

View File

@@ -1,11 +1,15 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
# CRUD
.. _crud:
CRUD
####
Chill provide an API to create a basic CRUD.
@@ -16,21 +20,30 @@ One can follow those steps to create a CRUD for one entity:
3. customize the templates if required ;
4. customize some steps of the controller if required ;
An example with the [`ClosingMotive`` (PersonBundle) in the admin part of Chill:
###### Auto-loading the routes
An example with the ``ClosingMotive`` (PersonBundle) in the admin part of Chill:
Auto-loading the routes
***********************
Ensure that those lines are present in your file `app/config/routing.yml`:
.. code-block:: yaml
chill_cruds:
resource: 'chill_main_crud_route_loader:load'
type: service
###### Create your model
Create your model
*****************
Create your model on the usual way (in this example, ORM informations are stored in yaml file):
```php
.. code-block:: php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\Common\Collections\Collection;
@@ -49,40 +62,41 @@ Create your model on the usual way (in this example, ORM informations are stored
* @var array
*/
private $name;
/**
*
* @var boolean
*/
private $active = true;
/**
*
* @var self
*/
private $parent = null;
/**
* child Accompanying periods
*
* @var Collection
*/
private $children;
/**
*
* @var float
*/
private $ordering = 0.0;
// getters and setters come here
}
```
The form:
```php
.. code-block:: php
namespace Chill\PersonBundle\Form;
use Symfony\Component\Form\AbstractType;
@@ -94,7 +108,8 @@ The form:
use Symfony\Component\Form\Extension\Core\Type\NumberType;
/**
###### *
*
*
*/
class ClosingMotiveType extends AbstractType
{
@@ -130,21 +145,22 @@ The form:
;
}
}
```
###### Configure the crud
Configure the crud
******************
The crud is configured using the key ``crud`` under ``chill_main``
```yaml
.. code-block:: yaml
chill_main:
cruds:
-
-
# the class which is concerned by the CRUD
class: '\Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class'
# give a name for the crud. This will be used internally
name: closing_motive
# add a base path for the
# add a base path for the
base_path: /admin/closing-motive
# this is the form class
form_class: 'Chill\PersonBundle\Form\ClosingMotiveType::class'
@@ -154,8 +170,8 @@ The crud is configured using the key ``crud`` under ``chill_main``
# this is a list of action you can configure
# by default, the actions `index`, `view`, `new` and `edit` are automatically create
# you can add more actions or configure some details about them
actions:
index:
actions:
index:
# the default template for index is very poor,
# you will need to override it
template: '@ChillPerson/ClosingMotive/index.html.twig'
@@ -164,16 +180,16 @@ The crud is configured using the key ``crud`` under ``chill_main``
new:
role: ROLE_ADMIN
# by default, the template will only show the form
# you can override it
# you can override it
template: '@ChillPerson/ClosingMotive/new.html.twig'
edit:
role: ROLE_ADMIN
template: '@ChillPerson/ClosingMotive/edit.html.twig'
```
To leave the bundle autoconfigure the ``chill_main`` bundle, you can `prepend the configuration of the ChillMain Bundle ](https://symfony.com/doc/current/bundles/prepend_extension.html):
To leave the bundle auto-configure the ``chill_main`` bundle, you can `prepend the configuration of the ChillMain Bundle <https://symfony.com/doc/current/bundles/prepend_extension.html>`_:
.. code-block:: php
```php
namespace Chill\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -188,13 +204,13 @@ To leave the bundle autoconfigure the ``chill_main`` bundle, you can `prepend th
{
// skipped here
}
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container)
{
$this->prependCruds($container);
}
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
@@ -224,17 +240,20 @@ To leave the bundle autoconfigure the ``chill_main`` bundle, you can `prepend th
]);
}
}
```
###### Customize templates
The current template is quite basic. You can override and extends them.
Customize templates
*******************
The current template are quite basic. You can override and extends them.
For a better inclusion, you can embed them instead of extending them.
For index. Note that we extend here the `admin` layout, not the default one:
```php
.. code-block:: html+jinja
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% block admin_content %}
@@ -269,11 +288,11 @@ For index. Note that we extend here the `admin` layout, not the default one:
{% endblock %}
{% endembed %}
{% endblock %}
```
For edit template:
```php
.. code-block:: html+jinja
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% block title %}
@@ -290,6 +309,8 @@ For edit template:
For new template:
.. code-block:: html+jinja
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% block title %}
@@ -301,16 +322,17 @@ For new template:
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}
```
###### Customize some steps in the controller
Customize some steps in the controller
**************************************
Some steps may be customized by overriding the default controller and some methods. Here, we will override the way the entity is created, and the ordering of the "index" page:
* we will associate a parent ClosingMotive to the element if a parameter `parent_id` is found ;
* we will order the ClosingMotive by the ``ordering`` property
```php
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
@@ -354,13 +376,14 @@ Some steps may be customized by overriding the default controller and some metho
return $query->orderBy('e.ordering', 'ASC');
}
}
```
###### How-to and questions
How-to and questions
********************
## Which role is required for each action ?
Which role is required for each action ?
========================================
By default, each action will use:
By default, each action will use:
1. the role defined under the action key ;
2. the base role as upper, with the action name appended:
@@ -373,21 +396,22 @@ By default, each action will use:
The entity will be passed to the role:
* for the ``view`` and ``edit`` action: the entity fetched from database
* for the ``new`` action: the entity which is created (you can override default values using
* for index action (or if you re-use the ``indexAction`` method: ``null``
## How to add some route and actions ?
* for the ``new`` action: the entity which is created (you can override default values using
* for index action (or if you re-use the ``indexAction`` method: ``null``
How to add some route and actions ?
===================================
Add them under the action key:
```yaml
.. code-block:: yaml
chill_main:
cruds:
-
-
# snipped
actions:
myaction: ~
```
The method `myactionAction` will be called by the parameter.
@@ -395,12 +419,13 @@ Inside this action, you can eventually call another internal method:
* ``indexAction`` for a list of items ;
* ``viewAction`` for a view
* ``editFormAction`` for an edition
* ``editFormAction`` for an edition
* ``createFormAction`` for a creation
Example:
```php
.. code-block:: php
namespace CSConnectes\SPBundle\Controller;
use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController;
@@ -431,29 +456,34 @@ Example:
}
}
```
## How to create a CRUD for entities associated to persons
How to create a CRUD for entities associated to persons
=======================================================
The bundle person provide some controller and template you can override, instead of the ones present in the mainbundle:
* `Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController` for entities linked with a one-to-may association to `Person` class ;
* `Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController` for entities linked with a one-to-one association to `Person` class.
* :code:`Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController` for entities linked with a one-to-may association to :code:`Person` class ;
* :code:`Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController` for entities linked with a one-to-one association to :code:`Person` class.
There are also template defined under ``@ChillPerson/CRUD/`` namespace.
Those controllers assume that:
Those controller assume that:
* the entity provide the method `getPerson` and `setPerson` ;
* the entity provide the method :code:`getPerson` and :code:`setPerson` ;
* the `index`'s id path will be the id of the person, and the ids in `view` and `edit` path will be the id of the entity ;
This bundle also uses by default the templates inside ``@ChillPerson/CRUD/``.
This bundle also use by default the templates inside ``@ChillPerson/CRUD/``.
###### Reference
## Configuration reference
Reference
*********
Configuration reference
=======================
.. code-block:: txt
```yaml
chill_main:
cruds:
@@ -484,8 +514,9 @@ This bundle also uses by default the templates inside ``@ChillPerson/CRUD/``.
# the template to render the view
template: null
```
## Twig default block
Twig default block
==================
This part should be documented.

View File

@@ -1,70 +0,0 @@
# Database Principles
This page provides a global understanding of the Chill database and explains some implementation details that help accelerate processing from the database or exploit it more easily.
!!! warning "Database Schema Stability"
The stability of the database schema is not guaranteed.
However, it evolves relatively little. It is rare for tables or columns to be deleted or renamed, but it is not guaranteed that this cannot happen.
## Overview
A commented list of all tables is available in CSV format at `./database/table_list.csv`.
### Schema and naming conventions
At the beginning of Chill's history, PostgreSQL schemas were not used. Data was stored in the `public` schema.
Later, new bundles appeared, and tables were classified into dedicated schemas.
Currently:
- for older bundles, those that already have tables in the public schema, new tables are added to this schema. They are prefixed with `chill_<bundle_name>_`;
- for more recent bundles, tables are created in the dedicated schema
### Historical data
Some data is historized:
- the referents of an accompanying period;
- the statuses of an accompanying period;
- the link between territories and users;
- etc.
In these cases, Chill generally creates two columns, which are usually named `startDate` and `endDate`. When the `endDate` column is `NULL`, it means that the period is not "closed". The `startDate` column is not nullable.
In some cases, the current data (referent of an accompanying period, for example) is also repeated at the table level itself. For example, the accompanying periods table `chill_person_accompanying_period` has a `step` column (the status of the period) and `user_id` (referent id) in addition to the history. Although redundant, this simplifies processing.
## Special relationships
### Users, households, addresses
Users have an address through households: in the interface, the address is recorded in the household file, and it is "given" to users who are members of the household, **and** who share the address of this household. Indeed, it is possible that users "belong" to a household without being domiciled there: this is the case, for example, for children in shared custody.
The history of users' membership in the household is preserved, as well as the history of addresses for the same household.
The tables involved are as follows:
- the `chill_person_person` table lists the users;
- the `chill_person_household_members` table lists household memberships: this is the junction between users and households:
- the `startDate` and `endDate` columns indicate the start and end date of membership;
- the `shareHousehold` column indicates whether the user shares the household address (if yes, its value is `TRUE`)
- the `chill_person_household` table lists households
- the `chill_person_household_to_addresses` table associates households with addresses;
- the `chill_main_address` table contains addresses, indicating the validity start date (`validFrom`) and the validity end date (`validTo`).
To simplify the resolution of addresses and users, two views have been implemented:
- the `view_chill_person_household_address` view takes up, for each user, the history of household memberships broken down by the address history of a household.
In other words, a line is created each time a user changes household, or a household changes address. It is therefore possible to find the complete address history for a given user via this table.
- the `view_chill_person_current_address` view takes up the current address of users.
### Addresses and geographical units
Chill provides statistics on the location of addresses relative to geographical zones (`chill_main_geographical_unit`).
Since the geographical resolution of addresses is costly in CPU and processing time, a materialized view has been created: `view_chill_main_address_geographical_unit`. It is refreshed daily in the production database.
## Table list and comments
A commented list of all tables is available in CSV format at `./database/table_list.csv`.

View File

@@ -0,0 +1,84 @@
.. database-principles:
Principes de la base de données
###############################
Cette page donne une compréhension globale de la base de donnée de Chill, et explique quelques détails d'implémentations qui permettent d'accélérer les traitements à partir de la base de donnée, ou de l'exploiter plus aisément.
Cette page est rédigée en français.
.. note::
La stabilité du schéma de la base de donnée n'est pas garantie.
Toutefois, ce dernier évolue relativement peu. Il est rare que des tables ou des colonnes soient supprimées ou renommées. Mais il n'est pas garanti que cela puisse arriver.
Généralités
===========
Une liste commentée de toutes les tables :download:`est disponible au format CSV <./database/table_list.csv`.
Schéma et conventions de nommage
--------------------------------
Au début de l'histoire de Chill, les schémas postgresql n'étaient pas exploités. Les données étaient stockées dans le schéma :code:`public`.
Par la suite, des nouveaux bundles sont apparus, et les tables ont été classées dans des schémas dédiés.
A l'heure actuelle:
- pour les anciens bundle, ceux qui ont déjà des tables dans le schéma public, les nouvelles tables sont ajoutées à ce schéma. Elles sont préfixées par :code:`chill_<nom du bundle>_`;
- pour les bundles plus récents, les tables sont créées dans le schéma dédié
Données avec de l'historicité
-----------------------------
Certaines données sont historisées:
- les référents d'un parcours;
- les statuts d'un parcours;
- la liaison entre les centres et les usagers;
- etc.
Dans ces cas-là, Chill crée généralement deux colonnes, qui sont habituellement nommées :code:`startDate` et :code:`endDate`. Lorsque la colonne :code:`endDate` est à :code:`NULL`, cela signifie que la période n'est pas "fermée". La colonne :code:`startDate` n'est pas nullable.
Dans certains cas, la donnée actuelle (référent d'un parcours, par exemple) est également répétée au niveau de la table en elle-même. Par exemple, la table des parcours :code:`chill_person_accompanying_period` comporte une colonne :code:`step` (le statut du parcours) et :code:`user_id` (id du référent) en plus de l'historique. Bien que redondant, cela simplifie les traitements.
Relations particulières
=======================
Usagers, ménages, adresses
--------------------------
Les usagers ont une adresse au travers des ménages: dans l'interface, l'adresse est inscrite dans le dossier du ménage, et elle est "donnée" aux usagers membres du ménage, **et** qui partagent l'adresse de ce ménage. En effet, il est possible que des usagers "appartiennent" à un ménage sans y être domicilié: c'est le cas, par exemple, des enfants en garde alternée.
L'historique de l'appartenance des usagers au ménage est conservée, de même que l'historique des adresses pour un même ménage.
Les tables en jeu sont les suivantes:
- la table :code:`chill_person_person` liste les usagers;
- la table :code:`chill_person_household_members` liste les appartenances au ménage: il s'agit de la jointure entre les usagers et les ménages:
- les colonnes :code:`startDate` et :code:`endDate` indiquent la date de début et la date de fin de l'appartenance;
- la colonne :code:`shareHousehold` indique si l'utilisateur partage l'adresse du ménage (si oui, sa valeur est :code:`TRUE`)
- la table :code:`chill_person_household` liste les ménages
- la table :code:`chill_person_household_to_addresses` associe les ménages aux adresses;
- la table :code:`chill_main_address` contient les adresses, en indiquant la date de début de validité (:code:`validFrom`) et la fin de validité (:code:`validTo`).
Pour simplifier la résolution des adresses et des usagers, deux vues ont été mises en œuvre:
- la vue :code:`view_chill_person_household_address` reprend, pour chaque usager, l'historique des appartenances au ménage découpée par l'historique des adresses d'un ménage.
Autrement dit, une ligne est créée à chaque fois qu'un usager change de ménage, ou qu'un ménage change d'adresse. Il est donc possible de retrouver l'historique complet des adresses pour un usager donné via cette table.
- la vue :code:`view_chill_person_current_address` reprend l'adresse actuelle des usagers.
Adresses et unités géographiques
--------------------------------
Chill propose des statistiques sur la localisation des adresses par rapport à des zones géographiques (:code:`chill_main_geographical_unit`).
Comme la résolution géographique des adresses est coûteuse en CPU et en temps de traitement, une vue matérialisée a été créée: :code:`view_chill_main_address_geographical_unit`. Elle est rafraichie quotidiennement dans la base de donnée de production.
Liste des tables et commentaires
================================
Une liste commentée de toutes les tables :download:`est disponible au format CSV <./database/table_list.csv`.

View File

@@ -1,6 +1,6 @@
order,table_schema,table_name,commentaire
1,chill_3party,party_category,Catégorie de tiers
2,chill_3party,party_center,Association entre les tiers et les territoires (déprécié)
2,chill_3party,party_center,Association entre les tiers et les centres (déprécié)
3,chill_3party,party_profession,Profession du tiers (déprécié)
4,chill_3party,third_party,Tiers
5,chill_3party,thirdparty_category,association tiers - catégories
@@ -54,7 +54,7 @@ order,table_schema,table_name,commentaire
53,public,activitytpresence,Présence aux échanges
54,public,activitytype,Types d'échanges
55,public,activitytypecategory,Catégories de types d'échanges
56,public,centers,"Territoires (territoires, agences, etc.)"
56,public,centers,"Centres (territoires, agences, etc.)"
57,public,chill_activity_activity_chill_person_socialaction,
58,public,chill_activity_activity_chill_person_socialissue
59,public,chill_docgen_template,Gabarits de documents
@@ -111,7 +111,7 @@ order,table_schema,table_name,commentaire
110,public,chill_person_marital_status,Etats civils
111,public,chill_person_not_duplicate,
112,public,chill_person_person,Usagers
113,public,chill_person_person_center_history,Historique des territoires d'un usagers
113,public,chill_person_person_center_history,Historique des centres d'un usagers
114,public,chill_person_persons_to_addresses,Déprécié
115,public,chill_person_phone,Numéros d etéléphone supplémentaires d'un usager
116,public,chill_person_relations,Types de relations de filiation
@@ -142,7 +142,7 @@ order,table_schema,table_name,commentaire
141,public,permission_groups
142,public,permissionsgroup_rolescope
143,public,persons_spoken_languages
144,public,regroupment,Regroupement de territoires
144,public,regroupment,Regroupement de centres
145,public,regroupment_center,
146,public,role_scopes,
147,public,scopes,Services
1 order table_schema table_name commentaire
2 1 chill_3party party_category Catégorie de tiers
3 2 chill_3party party_center Association entre les tiers et les territoires (déprécié) Association entre les tiers et les centres (déprécié)
4 3 chill_3party party_profession Profession du tiers (déprécié)
5 4 chill_3party third_party Tiers
6 5 chill_3party thirdparty_category association tiers - catégories
54 53 public activitytpresence Présence aux échanges
55 54 public activitytype Types d'échanges
56 55 public activitytypecategory Catégories de types d'échanges
57 56 public centers Territoires (territoires, agences, etc.) Centres (territoires, agences, etc.)
58 57 public chill_activity_activity_chill_person_socialaction
59 58 public chill_activity_activity_chill_person_socialissue
60 59 public chill_docgen_template Gabarits de documents
111 110 public chill_person_marital_status Etats civils
112 111 public chill_person_not_duplicate
113 112 public chill_person_person Usagers
114 113 public chill_person_person_center_history Historique des territoires d'un usagers Historique des centres d'un usagers
115 114 public chill_person_persons_to_addresses Déprécié
116 115 public chill_person_phone Numéros d etéléphone supplémentaires d'un usager
117 116 public chill_person_relations Types de relations de filiation
142 141 public permission_groups
143 142 public permissionsgroup_rolescope
144 143 public persons_spoken_languages
145 144 public regroupment Regroupement de territoires Regroupement de centres
146 145 public regroupment_center
147 146 public role_scopes
148 147 public scopes Services

View File

@@ -1,17 +1,30 @@
# Embeddable comments
.. Copyright (C) 2016 Champs Libres Cooperative SCRLFS
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".
Embeddable comments
###################
Those embeddable comments is a comment with some metadata:
* the one who updated the comment (the comment itself, and not the whole entity);
* the date and time for the last update (again, the comment itself, and not the whole entity).
We make usage of [embeddable ](https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/tutorials/embeddables.html).
We make usage of `embeddables <https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/tutorials/embeddables.html>`_.
## Embed the comment
Embed the comment
=================
The comment may be embedded into the entity:
```php
.. code-block:: php
namespace Chill\ActivityBundle\Entity;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
@@ -38,6 +51,7 @@ The comment may be embedded into the entity:
*/
private $comment;
/**
* @return \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable
*/
@@ -54,21 +68,27 @@ The comment may be embedded into the entity:
$this->comment = $comment;
}
}
```
## Note on relation to :class:`User`
Note on relation to :class:`User`
=================================
The embeddable proposed by Doctrine does not support relationship to other entities. The entity Comment is able to render a user's id, but not an User object.
`$activity->getComment()->getUserId(); // return user id of the last author`
`$activity->getComment()->getUser(); // does not work !`
.. code-block:: php
## Usage into form
$activity->getComment()->getUserId(); // return user id of the last author
Use the `Chill\MainBundle\Form\Type\CommentType` to load the form widget:
$activity->getComment()->getUser(); // does not work !
Usage into form
===============
Use the :class:`Chill\MainBundle\Form\Type\CommentType` to load the form widget:
.. code-block:: php
```php
namespace Chill\ActivityBundle\Form;
use Chill\MainBundle\Form\Type\CommentType;
@@ -90,8 +110,12 @@ Use the `Chill\MainBundle\Form\Type\CommentType` to load the form widget:
;
}
}
```
## Render the comment
Render the comment
==================
.. code-block:: twig
{{ activity.comment|chill_entity_render_box }}
`{{ activity.comment|chill_entity_render_box }}`

View File

@@ -1,4 +1,16 @@
# Stats about event on entity in php world
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
.. _entity-info:
Stats about event on entity in php world
########################################
It is necessary to be able to gather information about events for some entities:
@@ -6,9 +18,11 @@ It is necessary to be able to gather information about events for some entities:
- who did it;
- ...
Those "infos" are not linked with right management, like describe in [timelines`.
Those "infos" are not linked with right management, like describe in :ref:`timelines`.
### “infos” for some stats and info about an entity
“infos” for some stats and info about an entity
-----------------------------------------------
Building an info means:
@@ -18,10 +32,10 @@ Building an info means:
A framework api is built to be able to build multiple “infos” entities
through “union” views:
- use a command ``bin/console chill:db:sync-views`` to synchronize view (create view if it does not exist, or update
- use a command ``bin/console chill:db:sync-views`` to synchronize view (create view if it does not exists, or update
views when new SQL parts are added in the UNION query. Internally, this command call a new ``ViewEntityInfoManager``,
which iterate over available views to build the SQL;
- one can create new “view entity info” by implementing a
- one can create a new “view entity info” by implementing a
``ViewEntityInfoProviderInterface``
- this implementation of the interface is free to create another
interface for building each part of the UNION query. This interface
@@ -31,13 +45,14 @@ through “union” views:
So, converting new “events” into rows for ``AccompanyingPeriodInfo`` is
just implementing this interface!
### Implementation for AccompanyingPeriod (``AccompanyingPeriod/AccompanyingPeriodInfo``)
Implementation for AccompanyingPeriod (``AccompanyingPeriod/AccompanyingPeriodInfo``)
-------------------------------------------------------------------------------------
A class is created for computing some statistical info for an
AccompanyingPeriod: ``AccompanyingPeriod/AccompanyingPeriodInfo``. This
contains information about “something happens”, who did it and when.
Having that info in the table answers some questions like:
Having those info in table answer some questions like:
- when is the last and the first action (AccompanyingPeriodWork,
Activity, AccompanyingPeriodWorkEvaluation, …) on the period;
@@ -45,43 +60,46 @@ Having that info in the table answers some questions like:
user.
The AccompanyingPeriod info is mapped to a SQL view, not a table. The
SQL view is built dynamically (see below), and gathers info from
sql view is built dynamically (see below), and gather infos from
ActivityBundle, PersonBundle, CalendarBundle, … It is possible to create
a custom bundle and add info on this view.
custom bundle and add info on this view.
.. code:: php
```php
/**
*
* @ORM\Entity()
* @ORM\Table(name="view_chill_person_accompanying_period_info") ](==== THIS IS A VIEW, NOT A TABLE
* @ORM\Table(name="view_chill_person_accompanying_period_info") <==== THIS IS A VIEW, NOT A TABLE
*/
class AccompanyingPeriodInfo
{
// ...
}
```
#### Why do we need this?
Why do we need this ?
~~~~~~~~~~~~~~~~~~~~~
For multiple jobs in a PHP world:
For multiple jobs in PHP world:
- moving the accompanying period to another step when inactive,
- moving the accompanying period to another steps when inactive,
automatically;
- listing all the users which are intervening on the action on a new
“Liste des intervenants” page;
- filtering on exports
Later we will launch automatic anonymize for an accompanying period and
Later, we will launch automatic anonymise for accompanying period and
all related entities through this information.
#### How are the SQL views built that are mapped to “info” entities?
How is built the SQL views which is mapped to “info” entities ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The AccompanyingPeriodInfo entity is mapped by a SQL view (not a regular
table).
The SQL view is built dynamically; it is a SQL view like this, for now (April 2023):
The sql view is built dynamically, it is a SQL view like this, for now (April 2023):
.. code:: sql
```sql
create view view_chill_person_accompanying_period_info
(accompanyingperiod_id, relatedentity, relatedentityid, user_id, infodate, discriminator, metadata) as
SELECT w.accompanyingperiod_id,
@@ -173,14 +191,13 @@ The SQL view is built dynamically; it is a SQL view like this, for now (April 20
FROM activity
LEFT JOIN activity_user au ON activity.id = au.activity_id
WHERE activity.accompanyingperiod_id IS NOT NULL;
```
As you can see, the view gathers multiple SELECT queries and binds them
As you can see, the view gather multiple SELECT queries and bind them
with UNION.
Each SELECT query is built dynamically, through a class implementing an
interface: ``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``, `like
here <https://gitlab.com/Chill-Projet/chill-bundles/-/blob/master/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php.md)__
here <https://gitlab.com/Chill-Projet/chill-bundles/-/blob/master/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php>`__
To add new `SELECT` query in different `UNION` parts in the SQL view, create a
To add new `SELECT` query in different `UNION` parts in the sql view, create a
service and implements this interface: ``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``.

View File

@@ -1,10 +1,12 @@
## ESLint
ESLint
======
To improve the quality of our JS and VueJS code, ESLint and eslint-plugin-vue are implemented within the chill-bundles project.
### Commands
Commands
--------
To run ESLint, you can simply use the [`eslint`` command within the chill-bundles directory.
To run ESLint, you can simply use the ``eslint`` command within the chill-bundles directory.
This runs eslint **not** taking the baseline into account, thus showing all existing errors in the project.
A script was also added to package.json allowing you to execute ``yarn run eslint``.
@@ -17,18 +19,20 @@ Interesting options that can be used in combination with eslint are:
- ``--quiet`` to only get errors and silence the warnings
- ``--fix`` to have ESLint fix what it can, automatically. This will not fix everything.
### Baseline
Baseline
--------
To allow us the time to fix linting errors/warnings, a baseline has been created using the following command
To allow us the time to fix linting errors/warnings a baseline has been created using the following command
- ``npx eslint-baseline "**/*.{js,vue}"``
The baseline has been committed and the gitlab CI setup to only fail upon new errors/warnings being created.
The baseline has been commited and the gitlab CI setup to only fail upon new errors/warnings being created.
When fixing errors/warnings manually, please update the baseline.
1. Delete the current baseline file
2. Run the above command locally, this will automatically create a new baseline that should be commited
### Rules
Rules
-----
We use Vue 3, so the rules can be configured as follows within the ``eslint.config.mjs`` file:
@@ -41,14 +45,17 @@ Configurations for using Vue.js 3.x:
- ``.configs["flat/recommended"]`` ... Above, plus rules to enforce subjective community defaults to ensure consistency.
Detailed information about which rules each set includes can be found here:
`https://eslint.vuejs.org/rules/ ](https://eslint.vuejs.org/rules/)
`https://eslint.vuejs.org/rules/ <https://eslint.vuejs.org/rules/>`_
### Manual Rule Configuration
Manual Rule Configuration
-------------------------
We can also manually configure certain rules or override rules that are part of the ruleset specified above.
For example, if we want to turn off a certain rule, we can do so as follows:
.. code-block:: javascript
rules: {
'vue/multi-word-component': 'off'
}
@@ -57,6 +64,8 @@ We could also change the severity of a certain rule from 'error' to 'warning', f
Within specific ``.js`` or ``.vue`` files, we can also override a certain rule only for that specific file by adding a comment:
.. code-block:: javascript
/* eslint multi-word-component: "off", no-child-content: "error"
--------
Here's a description about why this configuration is necessary. */

View File

@@ -0,0 +1,84 @@
@startuml
'https://plantuml.com/sequence-diagram
autonumber
User -> ExportController: configure export using form
activate ExportController
ExportController -> ExportForm: build form
activate ExportForm
loop for every ExportElement (Filter, Aggregator)
ExportForm -> ExportElement: `buildForm`
activate ExportElement
ExportElement -> ExportForm: add form to builders
deactivate ExportElement
end
ExportForm -> ExportController
deactivate ExportForm
ExportController -> User: show form
deactivate ExportController
note left of User: Configure the export:\ncheck filters, aggregators, …
User -> ExportController: post configuration of the export
activate ExportController
ExportController -> ExportForm: `getData`
activate ExportForm
ExportForm -> ExportController: return data: list of entities, etc.
deactivate ExportForm
loop for every ExportElement (Filter, Aggregator)
ExportController -> ExportElement: serializeData (data)
activate ExportElement
ExportElement -> ExportController: return serializedData (simple array with string, int, …)
deactivate ExportElement
end
ExportController -> Database: `INSERT INTO RequestGeneration_table` (insert new entity)
ExportController -> MessageQueue: warn about a new request
activate MessageQueue
ExportController -> User: "ok, generation is in process"
deactivate ExportController
note left of User: The user see a waiting screen
MessageQueue -> MessengerConsumer: forward the message to the MessengerConsumer
deactivate MessageQueue
activate MessengerConsumer
MessengerConsumer -> Database: `SELECT * FROM RequestGeneration_table WHERE id = %s`
activate Database
Database -> MessengerConsumer: return RequestGeneration with serializedData
deactivate Database
loop for every ExportElement (Filter, Aggregator)
MessengerConsumer -> ExportElement: deserializeData
activate ExportElement
ExportElement -> MessengerConsumer: return data (list of entities, etc.) from the serialized array
deactivate ExportElement
MessengerConsumer -> ExportElement: alter the sql query (`ExportElement::alterQuery`)
activate ExportElement
ExportElement -> MessengerConsumer: return the query with WHERE and GROUP BY clauses
deactivate ExportElement
end
MessengerConsumer -> MessengerConsumer: prepare the export
MessengerConsumer -> MessengerConsumer: save the export as a stored object
MessengerConsumer -> Database: `UPDATE RequestGeneration_table SET ready = true`
deactivate MessengerConsumer
User -> ExportController: pull every 5s to know if the export is generated
activate ExportController
ExportController -> User: warn the export is generated
deactivate ExportController
User -> ExportController: download the export from object storage
@enduml

View File

@@ -1,49 +1,66 @@
###### Exports
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
Exports
*******
Export is an important issue within the Chill software : users should be able to :
- compute statistics about their activity ;
- list "things" which are a part of their activities.
The [main bundle`_ provides a powerful framework to build custom queries with re-usable parts across differents bundles.
The `main bundle`_ provides a powerful framework to build custom queries with re-usable parts across differents bundles.
.. contents:: Table of content
:local:
`The issue where this framework was [discussed](https://git.framasoft.org/Chill-project/Chill-Main/issues/9)
.. seealso::
`The issue where this framework was discussed <https://git.framasoft.org/Chill-project/Chill-Main/issues/9>`_
Provides some information about the pursued features and architecture.
## Concepts
Concepts
========
### Some vocabulary: 3 "Export elements"
Some vocabulary: 3 "Export elements"
------------------------------------
Four terms are used for this framework :
Exports
provide some basic operation on the data. Two kinds of exports are available :
- computed data: it may be "the number of people," "the number of activities," "the duration of activities," ...
- list data: it may be "the list of people," "the list of activities," ...
- computed data : it may be "the number of people", "the number of activities", "the duration of activities", ...
- list data : it may be "the list of people", "the list of activities", ...
Filters
The filters create a filter on the data: it removes some information the user doesn't want to introduce in the computation done by the export.
Example of a filter: "people under 18-year-olds," "activities between the 1st of June and the 31st December," ...
Example of a filter: "people under 18 years olds", "activities between the 1st of June and the 31st December", ...
Aggregators
The aggregator aggregates the data into some group (some software use the term 'bucket').
Example of an aggregator: "group people by gender," "group people by nationality," "group activity by type," ...
Example of an aggregator : "group people by gender", "group people by nationality", "group activity by type", ...
Formatters
The formatters format the data into a :class:`Symfony\Component\HttpFoundation\Response`, which will be returned "as is" by the controller to the web client.
Example of a formatter: "format data as CSV", "format data as an ods spreadsheet," ...
Example of a formatter: "format data as CSV", "format data as an ods spreadsheet", ...
### Anatomy of an export
Anatomy of an export
---------------------
An export can be thought of as a sentence where each part of this sentence refers to one or multiple export elements. Examples :
**Example 1**: Count the number of people having at least one activity in the last month 12, and group them by nationality and gender, and format them in a CSV spreadsheet.
**Example 1**: Count the number of people having at least one activity in the last 12 month, and group them by nationality and gender, and format them in a CSV spreadsheet.
Here :
@@ -56,16 +73,21 @@ Here :
Note that :
- Aggregators, filters, exports and formatters are cross-bundle. Here the bundle *activity* provides a filter which is applied on an export provided by the person bundle ;
- Multiple aggregators or filters for one export may exist. Currently, only one export is allowed.
- Multiple aggregator or filter for one export may exist. Currently, only one export is allowed.
The result might be :
+-------------+--------+------------------+
| Nationality | Gender | Number of people |
| Russian | Male | 12 |
| Russian | Female | 24 |
| France | Male | 110 |
| France | Female| 150 |
+-----------------------+----------------+---------------------------+
| Nationality | Gender | Number of people |
+=======================+================+===========================+
| Russian | Male | 12 |
+-----------------------+----------------+---------------------------+
| Russian | Female | 24 |
+-----------------------+----------------+---------------------------+
| France | Male | 110 |
+-----------------------+----------------+---------------------------+
| France | Female | 150 |
+-----------------------+----------------+---------------------------+
**Example 2**: Count the average duration of an activity with type "meeting", which occurs between the 1st of June and the 31st of December, group them by week, and format the data in an OpenDocument spreadsheet.
@@ -81,97 +103,122 @@ The result might be :
+-----------------------+----------------------+
| Week | Number of activities |
+=======================+======================+
| 2015-10 | 10 |
+-----------------------+----------------------+
| 2015-11 | 12 |
+-----------------------+----------------------+
| 2015-12 | 10 |
+-----------------------+----------------------+
| 2015-13 | 9 |
+-----------------------+----------------------+
### Authorization and exports
Authorization and exports
-------------------------
Exports, filters, and aggregators should not show data the user is not allowed to see within the application.
Exports, filters and aggregators should not show data the user is not allowed to see within the application.
In other words, developers are required to take care of user authorization for each export.
There should be a specific role that grants permission to users who are allowed to build exports. For more simplicity, this role should apply on a center, and should not require special circles.
## How does the magic work?
How does the magic work ?
===========================
To build an export, we rely on the capacity of the database to execute queries with aggregate (i.e. GROUP BY) and filter (i.e. WHERE) instructions.
An export is an SQL query that is initiated by an export and modified by aggregators and filters.
An export is an SQL query which is initiated by an export, and modified by aggregators and filters.
**Example**: Count the number of people having at least one activity in the last month 12, and group them by nationality and gender
.. note::
**Example**: Count the number of people having at least one activity in the last 12 month, and group them by nationality and gender
1. The report initiates the query
```SQL
.. code-block:: SQL
SELECT count(people.*) FROM people
```
2. The filter adds a where and join clause :
```SQL
.. code-block:: SQL
SELECT count(people.*) FROM people
RIGHT JOIN activity
WHERE activity.date IS BETWEEN now AND 6 month ago
```
3. The aggregator "nationality" adds a GROUP BY clause and a column in the SELECT statement:
```sql
.. code-block:: sql
SELECT people.nationality, count(people.*) FROM people
RIGHT JOIN activity
WHERE activity.date IS BETWEEN now AND 6 month ago
GROUP BY nationality
```
4. The aggregator "gender" does the same job as the nationality aggregator : it adds a GROUP BY clause and a column in the SELECT statement :
```sql
.. code-block:: sql
SELECT people.nationality, people.gender, count(people.*)
FROM people RIGHT JOIN activity
WHERE activity.date IS BETWEEN now AND 6 month ago
GROUP BY nationality, gender
```
Each filter, aggregator, and filter may collect parameters from the user through a form. This form is appended to the export form. Here is an example.
Each filter, aggregator and filter may collect parameters from the user through a form. This form is appended to the export form. Here is an example.
.. figure:: /_static/screenshots/development/export_form-fullpage.png
The screenshot shows the export form for ``CountPeople`` (Nombre de personnes). The filter by date of birth is checked (*Filtrer par date de naissance de la personne*), which triggers a subform, which is provided by the :class:`Chill\PersonBundle\Export\Filter\BirthdateFilter`. The other unchecked filter does not show the subform.
Two aggregators are also checked: by Country of birth (*Aggréger les personnes par pays de naissance*, the corresponding class is :class:`Chill\PersonBundle\Export\Aggregator\CountryOfBirthAggregator`, which also triggers a subform. The aggregator by gender (*Aggréger les personnes par genre*) is also checked, but there is no corresponding subform.
Two aggregators are also checked : by Country of birth (*Aggréger les personnes par pays de naissance*, the corresponding class is :class:`Chill\PersonBundle\Export\Aggregator\CountryOfBirthAggregator`, which also triggers a subform. The aggregator by gender (*Aggréger les personnes par genre*) is also checked, but there is no corresponding subform.
### The Export Manager
The Export Manager
------------------
The Export manager (:class:`Chill\MainBundle\Export\ExportManager` is the central class which registers all exports, aggregators, filters, and formatters.
The Export manager (:class:`Chill\MainBundle\Export\ExportManager` is the central class which registers all exports, aggregators, filters and formatters.
The export manager is also responsible for orchestrating the whole export process, producing a :class:`Symfony\FrameworkBundle\HttpFoundation\Request` for each export request.
### The export form step
The export form step
--------------------
The form step allows you to build a form, combining different parts of the module.
The building of forms is split into different subforms, where each one is responsible for rendering their part of the form (aggregators, filters, and export).
.. figure:: /_static/puml/exports/form_steps.png
:scale: 40%
### The formatter form step
The formatter form step
-----------------------
The formatter form is processed *after* the user filled the export form. It is built the same way, but receives the data entered by the user on the previous step as parameters (i.e. export form). It may then adapt it accordingly (example: show a list of columns selected in aggregators).
### Processing the export
Processing the export
---------------------
This schema can explain the export process :
The export process can be explained by this schema :
.. figure:: /_static/puml/exports/processing_export.png
:scale: 40%
(Click to enlarge)
## Export, formatters, and filters explained
### Exports
Export, formatters and filters explained
========================================
Exports
-------
This is an example of the ``CountPerson`` export :
.. literalinclude:: /_static/code/exports/CountPerson.php
:language: php
:linenos:
* **Line 36**: the ``getType`` function returns a string. This string will be used to find the aggregtors and filters which will apply to this export.
* **Line 41**: a simple description to help users understand what your export does.
* **Line 46**: The title of the export. A summary of what your export does.
@@ -179,17 +226,26 @@ This is an example of the ``CountPerson`` export :
* **Line 56**: We initiate the query here...
* **Line 59**: We have to filter the query with centers the users checked in the form. We process the $acl variable to get all ``Center`` objects in one array
* **Line 63**: We create the query with a query builder.
* **Line 74**: We return the result but make sure to hydrate the results as an array.
* **Line 74**: We return the result, but make sure to hydrate the results as an array.
* **Line 103**: return the list of formatter types which are allowed to be applied on this filter
### Filters
Filters
-------
This is an example of the *filter by birthdate*. This filter asks some information through a form (`buildForm` is not empty), and this form must be validated. To perform this validation, we implement a new Interface: `Chill\MainBundle\Export\ExportElementValidatedInterface`:
This is an example of the *filter by birthdate*. This filter asks some information through a form (`buildForm` is not empty), and this form must be validated. To perform this validation, we implement a new Interface: :class:`Chill\MainBundle\Export\ExportElementValidatedInterface`:
.. literalinclude:: /_static/code/exports/BirthdateFilter.php
:language: php
.. todo::
Continue to explain the export framework
With many-to-* relationship, why should we set WHERE clauses in an EXISTS subquery instead of a JOIN?
-----------------------------------------------------------------------------------------------------
.. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main
With many-to-* relationship, why should we set WHERE clauses in an EXISTS subquery instead of a JOIN ?
``````````````````````````````````````````````````````````````````````````````````````````````````````
As we described above, the doctrine builder is converted into a sql query. Let's see how to compute the "number of course
which count at least one activity type with the id 7". For the purpose of this demonstration, we will restrict this on
@@ -197,65 +253,79 @@ two accompanying period only: the ones with id 329 and 334.
Let's see the list of activities associated with those accompanying period:
.. code-block:: sql
SELECT id, accompanyingperiod_id, type_id FROM activity WHERE accompanyingperiod_id IN (329, 334) AND type_id = 7
ORDER BY accompanyingperiod_id;
We see that we have 6 activities for the accompanying period with id 329, and only one for the 334's one.
| id | accompanyingperiod_id | type_id |
|------|----------------------|---------|
| 990 | 329 | 7 |
| 986 | 329 | 7 |
| 987 | 329 | 7 |
| 993 | 329 | 7 |
| 991 | 329 | 7 |
| 992 | 329 | 7 |
| 1000 | 334 | 7 |
.. csv-table::
:header: id, accompanyingperiod_id, type_id
990,329,7
986,329,7
987,329,7
993,329,7
991,329,7
992,329,7
1000,334,7
Let's calculate the average duration for those accompanying periods, and the number of period:
.. code-block:: sql
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)), COUNT(id) from chill_person_accompanying_period WHERE id IN (329, 334);
The result of this query is:
| AVG | COUNT |
|--------------------------------------------------|-------|
| 2 years 2 mons 21 days 12 hours 0 mins 0.0 secs | 2 |
.. csv-table::
:header: AVG, COUNT
Now, we count the number of accompanying period, adding a `JOIN` clause which make a link to the `activity` table, and add a `WHERE` clause to keep
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs,2
Now, we count the number of accompanying period, adding a :code:`JOIN` clause which make a link to the :code:`activity` table, and add a :code:`WHERE` clause to keep
only the accompanying period which contains the given activity type:
.. code-block:: sql
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
What are the results here?
What are the results here ?
| COUNT |
|-------|
| 7 |
.. csv-table::
:header: COUNT
`7` ! Why this result? Because the number of lines is duplicated for each activity. Let's see the list of rows which
7
:code:`7` ! Why this result ? Because the number of lines is duplicated for each activity. Let's see the list of rows which
are taken into account for the computation:
.. code-block:: sql
SELECT chill_person_accompanying_period.id, activity.id from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
| accompanyingperiod.id | activity.id |
|----------------------|-------------|
| 329 | 993 |
| 334 | 1000 |
| 329 | 987 |
| 329 | 990 |
| 329 | 991 |
| 329 | 992 |
| 329 | 986 |
.. csv-table::
:header: accompanyingperiod.id, activity.id
For each activity, a row is created and, as we count the number of non-null `accompanyingperiod.id` columns, we
329,993
334,1000
329,987
329,990
329,991
329,992
329,986
For each activity, a row is created and, as we count the number of non-null :code:`accompanyingperiod.id` columns, we
count one entry for each activity (actually, we count the number of activities).
So, let's use the `DISTINCT` keyword to count only once the equal ids:
So, let's use the :code:`DISTINCT` keyword to count only once the equal ids:
.. code-block::
SELECT COUNT(DISTINCT chill_person_accompanying_period.id) from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
@@ -263,31 +333,38 @@ So, let's use the `DISTINCT` keyword to count only once the equal ids:
Now, it works again...
| COUNT |
|-------|
| 2 |
.. csv-table::
:header: COUNT
But, for the average duration, this won't work: the duration which are equals (because the `openingdate` is the same and
`closingdate` is still `NULL`, for instance) will be counted only once, which will give unexpected result.
2
The solution is to move the condition "having an activity with activity type with id 7" in a `EXISTS` clause:
But, for the average duration, this won't work: the duration which are equals (because the :code:`openingdate` is the same and
:code:`closingdate` is still :code:`NULL`, for instance) will be counted only once, which will give unexpected result.
The solution is to move the condition "having an activity with activity type with id 7" in a :code:`EXISTS` clause:
.. code-block:: sql
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
The result is correct without `DISTINCT` keyword:
The result is correct without :code:`DISTINCT` keyword:
| COUNT |
|-------|
| 2 |
.. csv-table::
:header: COUNT
2
And we can now compute the average duration without fear:
.. code-block:: sql
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)) from chill_person_accompanying_period
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
Give the result:
| AVG |
|--------------------------------------------------|
| 2 years 2 mons 21 days 12 hours 0 mins 0.0 secs |
.. csv-table::
:header: AVG
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs

View File

@@ -1,25 +0,0 @@
# Forms and form types
###### Date picker
Class
`Chill\MainBundle\Form\Type\ChillDateType`
Extend
`Symfony\Component\Form\Extension\Core\Type\DateType`
Usage :
```
use Chill\MainBundle\Form\Type\ChillDateType;
$builder->add('date' ChillDateType::class);
```
###### Text editor
Add a text editor (by default).
Class
`Chill\MainBundle\Form\Type\ChillTextareaType`
Options
* `disable_editor` to disable text editor

View File

@@ -0,0 +1,42 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
.. _forms:
Forms and form types
####################
Date picker
***********
Class
:class:`Chill\MainBundle\Form\Type\ChillDateType`
Extend
:class:`Symfony\Component\Form\Extension\Core\Type\DateType`
Usage :
.. code-block:: php
use Chill\MainBundle\Form\Type\ChillDateType;
$builder->add('date' ChillDateType::class);
Text editor
***********
Add a text editor (by default).
Class
:class:`Chill\MainBundle\Form\Type\ChillTextareaType`
Options
* :code:`disable_editor` to disable text editor

View File

@@ -1,41 +0,0 @@
# Development
As Chill relies on the [symfony ](http://symfony.com) framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered.
- [Instructions to create a new bundle](create-a-new-bundle.md)
- [CRUD (Create - Update - Delete) for one entity](crud.md)
- [Helpers for building a REST API](api.md)
- [Routing](routing.md)
- [Menus](menus.md)
- [Forms](forms.md)
- [Access control model](access_control_model.md)
- [Messages to users](messages-to-users.md)
- [Pagination](pagination.md)
- [Localisation](localisation.md)
- [Logging](logging.md)
- [Database migrations](migrations.md)
- [Searching](searching.md)
- [Timelines](timelines.md)
- [Exports](exports.md)
- [Embeddable comments](embeddable-comments.md)
- [Run tests](run-tests.md)
- [ESLint](es-lint.md)
- [Useful snippets](useful-snippets.md)
- [Manual](manual/index.md)
- [Assets](assets.md)
- [Cron Jobs](cronjob.md)
- [Info about entities](entity-info.md)
- [Info about database (in French)](database-principles.md)
- [Developer FAQ](FAQ.md)
###### Layout and UI
- [Render entities automatically](render-entity.md)
- [Layout / Template usage](user-interface/layout-template-usage.md)
- [Classes and mixins](user-interface/css-classes.md)
- [Widgets](user-interface/widgets.md)
- [Javascript function](user-interface/js-functions.md)
###### Help, I am lost!
Write an email at info@champs-libres.coop, and we will help you!

View File

@@ -0,0 +1,59 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
Development
###########
As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered.
.. toctree::
:maxdepth: 2
Instructions to create a new bundle <create-a-new-bundle.rst>
CRUD (Create - Update - Delete) for one entity <crud.rst>
Helpers for building a REST API <api.rst>
Routing <routing.rst>
Menus <menus.rst>
Forms <forms.rst>
Access control model <access_control_model.rst>
Messages to users <messages-to-users.rst>
Pagination <pagination.rst>
Localisation <localisation.rst>
Logging <logging.rst>
Database migrations <migrations.rst>
Searching <searching.rst>
Timelines <timelines.rst>
Exports <exports.rst>
Embeddable comments <embeddable-comments.rst>
Run tests <run-tests.rst>
ESLint <es-lint.rst>
Useful snippets <useful-snippets.rst>
manual/index.rst
Assets <assets.rst>
Cron Jobs <cronjob.rst>
Info about entities <entity-info.rst>
Info about database (in French) <database-principles.rst>
Developer FAQ <FAQ.rst>
Layout and UI
**************
.. toctree::
:maxdepth: 2
Render entities automatically <render-entity.rst>
Layout / Template usage <user-interface/layout-template-usage.rst>
Classes and mixins <user-interface/css-classes.rst>
Widgets <user-interface/widgets.rst>
Javascript function <user-interface/js-functions.rst>
Help, I am lost !
*****************
Write an email at info@champs-libres.coop, and we will help you !

View File

@@ -1,30 +0,0 @@
###### Localisation
## Language in url
Language should be present in URL, conventionally as the first argument.
`/fr/your/url/here`
This allows users to change from one language to another one on each page, which may be useful in multilanguages teams. If the installation is single-language, the language switcher will not appears.
This is an example of routing defined in YAML :
```yaml
chill_person_general_edit:
pattern: /{_locale}/person/{person_id}/general/edit
defaults: {_controller: ChillPersonBundle:Person:edit }
```
## Date and time
The [Intl extension ](http://twig.sensiolabs.org/doc/extensions/intl.html) is enabled on the Chill application.
You may format date and time using the [localizeddate` function :
`date|localizeddate('long', 'none')`
By default, we prefer using the `long` format for date formatting.
[Documentation for Intl Extension](http://twig.sensiolabs.org/doc/extensions/intl.html)
Read the complete doc for the Intl extension.

View File

@@ -0,0 +1,49 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
Localisation
*************
Language in url
===============
Language should be present in URL, conventionnaly as first argument.
.. code-block:: none
/fr/your/url/here
This allow users to change from one language to another one on each page, which may be useful in multilanguages teams. If the installation is single-language, the language switcher will not appears.
This is an example of routing defined in yaml :
.. code-block:: yaml
chill_person_general_edit:
pattern: /{_locale}/person/{person_id}/general/edit
defaults: {_controller: ChillPersonBundle:Person:edit }
Date and time
==============
The `Intl extension <http://twig.sensiolabs.org/doc/extensions/intl.html>`_ is enabled on the Chill application.
You may format date and time using the `localizeddate` function :
.. code-block:: jinja
date|localizeddate('long', 'none')
By default, we prefer using the `long` format for date formatting.
.. seealso::
`Documentation for Intl Extension <http://twig.sensiolabs.org/doc/extensions/intl.html>`_
Read the complete doc for the Intl extension.

View File

@@ -1,41 +1,50 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2016 Champs Libres Cooperative SCRLFS
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".
###### Logging
Logging
*******
Symfony documentation: [How to user Monolog to write logs ](http://symfony.com/doc/current/cookbook/logging/monolog.html)
.. seealso::
Symfony documentation: `How to user Monolog to write logs <http://symfony.com/doc/current/cookbook/logging/monolog.html>`_
The symfony cookbook page about logging.
A channel for custom logging has been created to store sensitive data.
The channel is named ``chill``.
A channel for custom logging has been created to store sensitive data.
The channel is named ``chill``.
The installer of chill should be aware that this channel may contains sensitive data and encrypted during backup.
## Logging to channel `chill`
Logging to channel `chill`
============================
You should use the service named ``chill.main.logger``, as this :
You should use the service named ``chill.main.logger``, as this :
`$logger = $this->get('chill.main.logger');`
.. code-block:: php
You should store data into context, not in the log himself, which should remains the same for the action.
$logger = $this->get('chill.main.logger');
Example of usage :
You should store data into context, not in the log himself, which should remains the same for the action.
Example of usage :
.. code-block:: php
```php
$logger->info("An action has been performed about a person", array(
'person_lastname' => $person->getLastName(),
'person_firstname' => $person->getFirstName(),
'person_id' => $person->getId(),
'by_user' => $user->getUsername()
));
```
For further processing, it is a good idea to separate all fields (like firstname, lastname, ...) into different context keys.
By convention, you should store the username of the user performing the action under the ``by_user`` key.

View File

@@ -1,10 +1,17 @@
Permission is granted to copy, distribute and/or modify this document
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
###### Developer manual
Developer manual
*****************
.. toctree::
:maxdepth: 2
routing-and-menus.rst
- [Routing and Menus](routing-and-menus.md)

View File

@@ -1,103 +1,143 @@
###### Routing and menus
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
The architecture of *Chill* allows choosing a bundle on each installation. This may lead to a huge diversity of installations, and the developper challenge is to make his code work with all those possibles installations.
Routing and menus
*****************
The *Chill*'s architecture allows to choose bundle on each installation. This may lead to a huge diversity of installations, and a the developper challenge is to make his code working with all those possibles installations.
*Chill* uses menus to let users access easily to the most used functionalities. For instance, when you land on a "Person" page, you may access directly to his activities, notes, documents, ... in a single click on a side menu.
For a developer, it is easy to extend this menu with his own entries.
[Symfony documentation about routing ](http://symfony.com/doc/current/book/routing.html)
.. seealso::
`Symfony documentation about routing <http://symfony.com/doc/current/book/routing.html>`_
This documentation should be read before diving into those lines
[Routes dans Chill ](https://redmine.champs-libres.coop/issues/179) (FR)
`Routes dans Chill <https://redmine.champs-libres.coop/issues/179>`_ (FR)
The issue where we discussed routes. In French.
## Create routes
Create routes
==============
We recommend using `yaml` to define routes. We have not tested the existing other ways to create routes (annotations, ...). Help wanted.
.. note::
The first step is as easy as creating a route in symfony, and add some options in his description :
We recommand using `yaml` to define routes. We have not tested the existing other ways to create routes (annotations, ...). Help wanted.
The first step is as easy as create a route in symfony, and add some options in his description :
.. code-block:: yaml
```yaml
#src/CL/ChillBundle/Resources/config/routing.yml
chill_main_dummy_0:
pattern: /dummy/{personId}
defaults: { _controller: CLChillMainBundle:Default:index }
options:
#we begin menu information here :
menus:
foo: #must appear in a menu named 'foo'
menus:
foo: #must appears in menu named 'foo'
order: 500 #the order will be '500'
label: foolabel #the label shown on a menu. Will be translated
otherkey: othervalue #you may add other information, as needed by your layout
bar: #must also appear in a menu named 'bar'
label: foolabel #the label shown on menu. Will be translated
otherkey: othervalue #you may add other informations, as needed by your layout
bar: #must also appears in menu named 'bar'
order: 500
label: barlabel
```
The mandatory parameters under the `menus` definition are :
The mandatory parameters under the `menus` definition are :
* `name`: the menu's name, defined as a key for the following entries
* `order`. Note: if we have duplicate order's values, the order will be incremented. We recommend using big intervals within orders and publishing the orders in your documentation
* `label`: the text which will be rendered inside the `<a>[ tag. The label should be processed trough the `trans` filter (`{{ route.label|trans }}`)
* `name`: the menu's name, defined as an key for the following entries
* `order`. Note: if we have duplicate order's values, the order will be incremented. We recommand using big intervals within orders and publishing the orders in your documentation
* `label`: the text which will be rendered inside the `<a>` tag. The label should be processed trough the `trans` filter (`{{ route.label|trans }}`)
You *may* also add other keys, which will be used optionally in the way the menu is rendered. See
You *may* also add other keys, which will be used optionally in the way the menu is rendered. See
Although all keys will be kept from your `yaml` definition to your menu template, we recommend not using those keys, which are reserved for a future implementations of Chill :
.. warning::
* `helper`, a text to help user or add more information to him
* `access` : which will run a test with `Expression Langage ](http://symfony.com/doc/current/components/expression_language/index.html) to determine if the user has the ACL to show the menu entry ;
* `condition`, which will test with the menu context if the entry must appear
Although all keys will be kept from your `yaml` definition to your menu template, we recommend not using those keys, which are reserved for a future implementations of Chill :
## Show menu in twig templates
* `helper`, a text to help user or add more informations to him
* `access` : which will run a test with `Expression Langage <http://symfony.com/doc/current/components/expression_language/index.html>`_ to determine if the user has the ACL to show the menu entry ;
* `condition`, which will test with the menu context if the entry must appears
Show menu in twig templates
===========================
To show our previous menu in the twig template, we invoke the `chill_menu` function. This will render the `foo` menu :
`{{ chill_menu('foo') }}`
.. code-block:: jinja
##### Passing variables
{{ chill_menu('foo') }}
Passing variables
^^^^^^^^^^^^^^^^^
If your routes need arguments, i.e. an entity id, you should pass the as argument to the chill_menu function. If your route's pattern is `/person/{personId}`, your code become :
`{{ chill_menu('foo', { 'args' : { 'personId' : person.id } } ) }}`
.. code-block:: jinja
{{ chill_menu('foo', { 'args' : { 'personId' : person.id } } ) }}
Of course, `person` is a variable you must define in your code, which should have an `id` accessible property (i.e. : `$person->getId()`).
.. note::
Be aware that your arguments will be passed to all routes in a menu. If a route does not require `personId` in his pattern, the route will become `/pattern?personId=XYZ`. This should not cause problem in your application.
It is a good idea to reuse the same parameter's name in your pattern, to avoid collision. Prefer `/person/{personId}` to `/person/{id}`.
.. warning::
It is a good idea to reuse the same parameter's name in your pattern, to avoid collision. Prefer `/person/{personId}` to `/person/{id}`.
If you don't do that and another developer create a bundle with `person/{personId}/{id}` where `{id}` is the key for something else, this will cause a lot of trouble...
##### Rendering active entry
Rendering active entry
^^^^^^^^^^^^^^^^^^^^^^
Now, you want to render differently the *active* route of the menu [#f1]_. You should, in your controller or template, add the active route in your menu :
Now, you want to render differently the *active* route of the menu [#f1]_. You should, in your controller or template, add the active route in your menu :
`{{ chill_menu('foo', { 'activeRouteKey' : 'chill_main_dummy_0' } ) }}`
.. code-block:: jinja
{{ chill_menu('foo', { 'activeRouteKey' : 'chill_main_dummy_0' } ) }}
On menu creation, the route wich has the key `chill_main_dummy_0` will be rendered on a different manner.
### Define your own template
Define your own template
-------------------------
By default, the menu is rendered with the default template, which is a simple `ul` list. You may create your own templates :
```
.. code-block:: html+jinja
#MyBundle/Resources/views/Menu/MyMenu.html.twig
<ul class="myMenu">
{% for route in routes %}
<li><a href="{{ path(route.key, args ) }}" class="{%- if activeRouteKey == route.key -%}active{%- endif -%}">{{ route.label|trans }}</a></li>
{% endfor %}
</ul>
```
Arguments available in your template :
* The `args` value are the value passed in the 'args' arguments requested by the `chill_menu` function.
* `activeRouteKey` is the key of the currently active route.
* `activeRouteKey` is the key of the currently active route.
* `routes` is an array of routes. The array has this structure: `routes[order] = { 'key' : 'the_route_key', 'label' : 'the route label' }` The order is *resolved*: in case of collision (two routes from different bundles having the same order), the order will be incremented. You may find in the array your own keys (`{ 'otherkey' : 'othervalue'}` in the example above).
Then, you will call your own template with the `layout` argument :
`{{ chill_menu('foo', { 'layout' : 'MyBundle:Menu:MyMenu.html.twig' } ) }}`
.. code-block:: jinja
{{ chill_menu('foo', { 'layout' : 'MyBundle:Menu:MyMenu.html.twig' } ) }}
.. note::
Take care of specifying the absolute path to layout in the function.
.. rubric:: Footnotes
.. [#f1] In the default template, the currently active entry will be rendered with an "active" class : `<li class="active"> ... </li>`

View File

@@ -1,25 +1,44 @@
###### Menus
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
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".
.. _menus :
Menus
*****
Chill has created his own menu system
[Routes dans Chill [specification] ](https://redmine.champs-libres.coop/issues/179)
.. seealso::
`Routes dans Chill [specification] <https://redmine.champs-libres.coop/issues/179>`_
The issue wich discussed the implementation of routes.
## Concepts
Concepts
========
.. warning::
to be written
## Add a menu in a template
Add a menu in a template
========================
In your twig template, use the `chill_menu` function :
```php
.. code-block:: html+jinja
{{ chill_menu('person', {
'layout': 'ChillPersonBundle::menu.html.twig',
'args': {'id': person.id },
'args' : {'id': person.id },
'activeRouteKey': 'chill_person_view'
}) }}
```
The available arguments are:
@@ -27,61 +46,78 @@ The available arguments are:
* `args` : those arguments will be passed through the url generator.
* `activeRouteKey` must be the route key name.
.. note::
The argument `activeRouteKey` may be a twig variable, defined elsewhere in your template, even in child templates.
## Create an entry in an existing menu
Create an entry in an existing menu
===================================
If a route belongs to a menu, you simply add this to his definition in routing.yml :
```yaml
.. code-block:: yaml
chill_person_history_list:
pattern: /person/{person_id}/history
defaults: { _controller: ChillPersonBundle:History:list }
options:
#declare menus
menus:
# the route should be in the 'person' menu :
menus:
# the route should be in 'person' menu :
person:
#and have those arguments :
order: 100
label: menu.person.history
```
* `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.**
* `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.**
You may add additional keys, but should not use the keys described above.
You may add the same route to multiple menus :
```yaml
.. code-block:: yaml
chill_person_history_list:
pattern: /person/{person_id}/history
defaults: { _controller: ChillPersonBundle:History:list }
options:
menus:
menus:
menu1:
order: 100
label: menu.person.history
menu2:
order: 100
label: another.label
```
## Customize menu rendering
Customize menu rendering
========================
You may customize menu rendering by using the `layout` option.
.. warning ::
TODO : this part should be written.
TODO: this part should be written.
## Caveats
.. _caveats :
Caveats
=======
Currently, you may pass arguments globally to each menu, and they will be all passed to route url. This means that :
* the argument name in the route entry must match the argument key in the menu declaration in the twig template
* the argument name in the route entry must match the argument key in menu declaration in 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`)

View File

@@ -1,93 +0,0 @@
###### Messages to users, flashbags, and buttons
## Flashbags
The four following levels are defined :
+-----------+----------------------------------------------------------------------------------------------+
|Key|Intent |
|success|The user action succeeds. |
|notice|A simple message to give information to the user. The message may be linked or not linked with |
||the user action. |
|error|The user's action failed: he must correct something to process the action. |
We can use [TranslatableMessage` (and other `TranslatableMessageInterface` instances) into the controller:
```php
// in a controller action:
if (($session = $request->getSession()) instanceof Session) {
$session->getFlashBag()->add(
'success',
new TranslatableMessage('saved_export.Saved export is saved!')
);
}
```
`Flash Messages on Symfony documentation ](http://symfony.com/doc/current/book/controller.html#flash-messages)
Learn how to use flash messages in a controller.
## Buttons
Some actions are available to decorate ``a`` links and ``buttons``.
To add the action on button, use them as class along with ``sc-button`` :
<a class="sc-button bt-create">Create an entity</a>
<button class="sc-button bt-submit" type="submit">Submit</button>
+-----------+----------------+------------------------------------------------------------------------------+
| Action | Class | Description |
| Submit | ``bt-submit`` | Submit a form. Use only if the action is not "save." |
| Create | ``bt-create`` | - Link to a form to create an entity (alias: ``bt-new``) |
| | or ``bt-new`` | - Submitting this form will create a new entity |
| Reset | ``bt-reset`` | Reset a form |
| Delete | ``bt-delete`` | - Link to a form to delete an entity |
| | | - Submitting this form will remove the entity |
| Edit | ``bt-edit`` or | Link to a form to edit an entity |
| | ``bt-update`` | |
| Save | ``bt-save`` | Submitting this form will save change on the entity |
| Action | ``bt-action`` | Generic link to an action |
| Cancel | ``bt-cancel`` | Cancel an action and go back to another page |
### Styling buttons
Small buttons, mainly to use inline
`<p><a class="sc-button bt-create bt-small">You button</a></p>`
You can omit content and show a button with an icon only :
`<a class="sc-button bt-create"></a>`
You can hide content and show it only on hover
`<a class="sc-button bt-create has-hidden"><span class="show-on-hover">Showed when mouse pass on</span></a>`
You can customize the icon :
`<a class="sc-button bt-create change-icon"><i class="fa fa-icon"></i>Button with custom icon</a>`
### Grouping buttons
Grouping buttons can be done using ``ul.record_actions`` element (an ``ul`` list with class ``record_actions``):
```html
<ul class="record_actions">
<li class="cancel">
<a class="sc-button bt-cancel">Cancel</a>
<li>
<li>
<a class="sc-button bt-save">Save</a>
</li>
</ul>
```
The element with the ``cancel`` class will be set in first position.
Inside the table, the space between elements will be shorter.
You can add the class ``record_actions_small`` if you want shorter space between elements.

Some files were not shown because too many files have changed in this diff Show More