Compare commits

..

270 Commits

Author SHA1 Message Date
fad7bdf235 Add event subscriber to convert docs to PDF before signature
Introduce ConvertToPdfBeforeSignatureStepEventSubscriber to convert documents to PDF when reaching a signature step in the workflow. Includes tests to ensure the conversion process only triggers when necessary.
2024-09-10 14:29:20 +02:00
8521cea46c Add StoredObjectToPdfConverter service and unit tests
Introduced the StoredObjectToPdfConverter service to handle conversion of stored objects to PDF format. Added unit tests to ensure proper functionality, including versioning and exception handling.
2024-09-10 14:29:20 +02:00
4ead7ba761 Add signer type differentiation for workflows
Added a method to determine if the signer is a 'person' or 'user'. Updated the signature template to handle both types accordingly, ensuring the correct entity type is displayed in workflow signatures.
2024-09-10 14:29:20 +02:00
9721b166eb Enhance object version removal to exclude point-in-time versions
Add a check to exclude versions associated with points in time before deleting old object versions. This ensures that such versions are not mistakenly removed, providing greater data integrity. Updated tests and repository methods accordingly.
2024-09-10 14:29:20 +02:00
1b21cd6c33 Add StoredObjectPointInTime entity and related functionality
Implemented a new StoredObjectPointInTime entity to manage snapshots of stored objects. This includes related migrations, enum for reasons, repository, and integration with StoredObjectVersion.
2024-09-10 14:29:19 +02:00
97860a9487 Add WopiConverter service and update Collabora integration tests
Introduce the WopiConverter service to handle document-to-PDF conversion using Collabora Online. Extend and update related tests in WopiConvertToPdfTest and ConvertControllerTest for better coverage and reliability. Enhance the GitLab CI configuration to exclude new test category "collabora-integration".
2024-09-10 10:44:45 +02:00
2fb46c65c2 Refactor CancelStaleWorkflowCronJobTest to simplify setup
Replaced KernelTestCase with TestCase to simplify test setup and removed dependency on the database connection. Added NullLogger to replace mocked LoggerInterface during testing. Updated method call in tests to correctly reference CancelStaleWorkflowMessage class.
2024-09-09 15:16:10 +02:00
f4356ac249 Add test for detecting stale workflows and enhance handler
Added a new test to check if workflows are stale in EntityWorkflowTest. Enhanced CancelStaleWorkflowHandler to handle stale workflows more accurately, including checking if workflows have transitioned recently. Updated EntityWorkflow entity to cascade remove workflow steps.

Refactor tests for handler, to avoid using $kernel during tests
2024-09-09 15:08:39 +02:00
d152efe084 Refactor imports and remove redundant type strings
This commit refactors the usage of \DateTimeImmutable to ensure consistent namespacing and removes unnecessary string type declarations from constants in CancelStaleWorkflowCronJob. These changes improve code readability and maintainability.
2024-09-09 14:58:19 +02:00
ee9530d03f More conditions to find staled workflows 2024-09-09 10:46:35 +02:00
b97eabf0d2 Get workflowComponent directly from registry 2024-09-09 10:46:35 +02:00
2e69d2df90 Adjust test to work with actual workflow + minor fix of handler logic 2024-09-09 10:46:33 +02:00
cb446edd18 Suffix message class with 'Message' and add check on workflow to assert no transitions were applied since message placed in queue 2024-09-09 10:40:42 +02:00
5d84e997c1 Php cs fixes 2024-09-09 10:40:42 +02:00
35199b6993 Create test for CancelStaleWorkflowHandler: wip state 2024-09-09 10:40:42 +02:00
dab68fb409 Add CancelStaleWorkflowCronJobTest 2024-09-09 10:40:41 +02:00
6001bb6447 Add logger messages for possible debugging purposes 2024-09-09 10:40:41 +02:00
29fec50515 Add cronjob and repository method to find and cancel stale workflows every other day 2024-09-09 10:40:41 +02:00
34edb02cd0 Create message and handler for canceling stale workflows 2024-09-09 10:40:41 +02:00
860ae5cedf Create CancelStaleWorkflow message and handler 2024-09-09 10:40:40 +02:00
bf056046ab Fix cs 2024-09-06 14:40:25 +02:00
4d73f9b81a Rename Convert to ConvertController for clarity
Renamed Convert class and relevant references to ConvertController to improve clarity and maintain consistency. Updated corresponding test files and route configurations to reflect the new name.
2024-09-06 14:07:51 +02:00
dd159f4379 Merge branch '297-workflow-en-attente' into 'signature-app-master'
Allow user to put workflow on hold

See merge request Chill-Projet/chill-bundles!718
2024-09-06 12:02:40 +00:00
49ad25b4c8 Refactor WorkflowOnHoldController and improve tests
Refactored WorkflowOnHoldController to remove dependencies and improve redirect handling. Updated test cases to use PHPUnit instead of KernelTestCase and mock proper dependencies. Added relationship handling in EntityWorkflowStep to manage EntityWorkflowStepHold instances accurately.
2024-09-06 14:02:11 +02:00
ad94310981 Refactor workflow hold functionality to avoid relying on database to perform some checks on "user holds entityworkflow"
Simplify the logic in handling workflow on hold status by moving related checks and operations to `EntityWorkflowStep` and `EntityWorkflow` entities. This includes implementing new methods to check if a step or workflow is held by a specific user and refactoring the controller actions to use these methods.
2024-09-05 20:46:29 +02:00
e8f09b507f Fix cs after php-cs-fixer upgrade, fix phpstan and rector errors 2024-09-05 18:00:37 +02:00
e29e1db6ed Take into account 'destUserByAccessKey' in the list of workflows associated to a user
Refactor the query to include checks for user membership via both 'destUser' and 'destUserByAccessKey'. This ensures that workflows correctly account for user access by multiple criteria.
2024-09-05 17:38:18 +02:00
8c4f342ca1 Correct instantiation of controller within test 2024-09-05 17:19:28 +02:00
745a29f742 Adjust logic for removing the hold on a workflow only by user who owns the hold and when a transition is applied on the workflow 2024-09-05 17:19:27 +02:00
41ffc470a0 Adjust test to check creation of onHold if user is allowed to apply a transition 2024-09-05 17:19:27 +02:00
46b31ae1ea Adjust logic to only allow on hold if user is allowed to apply a transition 2024-09-05 17:19:26 +02:00
8c5e94e295 Work on test for workflowOnHold controller 2024-09-05 17:19:25 +02:00
9c8a84cdbd Add test for WorkflowOnHoldControllerTest 2024-09-05 17:19:24 +02:00
a82b99aecc Add template-extends on EntityWorkflowStepHoldRepository 2024-09-05 17:19:23 +02:00
deb4bda16e Add unique constraint as attribute on EntityWorkflowStepHold class 2024-09-05 17:19:23 +02:00
c1e5f4a57e Move onHold methods to a separate WorkflowOnHold controller 2024-09-05 17:19:20 +02:00
6fc5a10dc4 Add unique constraint to migration 2024-09-05 17:18:43 +02:00
18abc84e68 Rector fixes 2024-09-05 17:18:43 +02:00
e85c31826f php cs fixes 2024-09-05 17:18:42 +02:00
d119ba49f7 Add on_hold label to vue components 2024-09-05 17:18:42 +02:00
c21de777fd Place on_hold label next to breadcrumb in twig template 2024-09-05 17:18:42 +02:00
15eaf648df Add label to workflow listing and history to indicate whether it's on hold 2024-09-05 17:18:42 +02:00
42471269db Implement logic to put workflow on hold and resume it 2024-09-05 17:16:18 +02:00
9475a708c3 Add EntityWorkflowStepHold entity to allow workflow to be put on hold by user
Entity created, migration, and repository.
2024-09-05 17:13:20 +02:00
bf1af1aaad Merge branch '301-has-signed-statement' into 'signature-app-master'
Adjust behavior when signature in signed state

See merge request Chill-Projet/chill-bundles!717
2024-09-05 14:50:05 +00:00
8ea87053f0 fix some tests 2024-09-05 16:47:45 +02:00
3c9ee41b3b fix some tests 2024-09-04 18:30:18 +02:00
d0031e82e8 Add hover effect and slim class to dev assets and apply in signature list
Introduced a new SCSS file to handle hover effects on rows and added the ability to remove bottom margins with a "slim" class. Updated various twig templates to utilize these new styles for better visual feedback and alignment.
2024-09-04 17:55:01 +02:00
20f2bc6c35 Enhance signature display with detailed person information
Updated the signature view template to include person details using the '_insert_vue_onthefly.html.twig' template. This change adds more contextual information about the signer, such as their name and status, improving the user experience.
2024-09-04 17:26:46 +02:00
71d3aa3969 Refactor signature rendering logic
Reorganized the signature rendering loop for better readability. Moved the row alignment inside the loop and added text alignment for signed statements. Simplified the conditional checks within the loop to enhance code maintainability.
2024-09-04 17:24:11 +02:00
ce781a5b58 Translate datetime object with icu: split date and time
Translate datetime within icu format
2024-09-04 17:14:43 +02:00
2dd275a074 Merge branch '296-signature-menu-tab' into 'signature-app-master'
Add person menu entry for signature  list

See merge request Chill-Projet/chill-bundles!719
2024-09-04 15:13:14 +00:00
5f5d4b8f06 Add person menu entry for signature list 2024-09-04 15:13:14 +00:00
cc8214d52c Add flash message in case signature was already applied 2024-09-04 17:08:38 +02:00
0c797c2997 Redirect to workflow show page if document already signed
Verify the state of the signature. If isSigned is true, redirection to
workflow show page.
2024-09-04 17:08:37 +02:00
ee6edba206 Create isSigned method in EntityWorkflowStepSignature.php
Refactorization and ease of use in template and workflow controller
2024-09-04 17:08:35 +02:00
3e6d764b9b Replace sign button with signed statement if person/user has signed 2024-09-04 17:06:45 +02:00
3e5a558cdf Add exists method to RemoveOldVersionMessageHandlerTest
Introduce the exists method to handle checks for StoredObject or StoredObjectVersion in test cases. This modification ensures consistency and proper exception handling in the testing framework.
2024-09-04 15:18:07 +02:00
0e6b7d76a4 Add exists method to WebdavControllerTest
Included a new method `exists` to handle existence checks for StoredObject or StoredObjectVersion within WebdavControllerTest. This method currently always returns true, ensuring initial compatibility and providing a foundation for future logic refinements.
2024-09-04 15:10:18 +02:00
b2042bd1e4 Merge branch 'signature-app/object-version' into 'signature-app-master'
Add versioning to stored objects

See merge request Chill-Projet/chill-bundles!710
2024-09-04 12:46:43 +00:00
6e9f111fd9 Fix syntax errors in RemoveExpiredStoredObjectCronJob class
Correct syntax errors involving constant definitions in the RemoveExpiredStoredObjectCronJob class. This change ensures compliance with PHP's constant declaration standards.
2024-09-04 14:45:17 +02:00
313fb9ffdf PHP CS Fixer updated (3.63.1 -> v3.64.0) 2024-09-04 14:38:56 +02:00
063bc2857f Remove deprecated constants from StoredObjectNormalizer
Deleted the deprecated constants `ADD_DAV_SEE_LINK_CONTEXT` and `ADD_DAV_EDIT_LINK_CONTEXT` from the `StoredObjectNormalizer` class. These constants are no longer in use and their removal cleans up the codebase.
2024-09-04 14:34:49 +02:00
615629d1b4 Simplify entity relationship and enforce foreign key constraints
Removed the resetStoredObject() method call from StoredObject, adjusted the storedObjectId column in the stored_object_version table to be NOT NULL, and moved the association setup of the StoredObject entity directly into the constructor in StoredObjectVersion. This ensures that every StoredObjectVersion has a valid StoredObject and maintains database integrity.
2024-09-04 14:28:13 +02:00
667e144681 Add PDF signature zone availability checks
Introduce `PDFSignatureZoneAvailable` service to check available PDF signature zones. Updated `WorkflowAddSignatureController` to use the new service. Added unit tests to verify the correctness of the functionality.
2024-09-04 14:09:53 +02:00
e17203ca3a Add PDF signature zone availability checks
Introduce `PDFSignatureZoneAvailable` service to check available PDF signature zones. Updated `WorkflowAddSignatureController` to use the new service. Added unit tests to verify the correctness of the functionality.
2024-09-04 13:55:08 +02:00
c6a6d76790 Add signatureZoneIndex to PdfSignedMessage and related classes
Included signatureZoneIndex for PdfSignedMessage in class definitions, handlers, and serializers to support signature zones. Updated test cases to reflect this new property, ensuring robust validation for handling and serialization.
2024-09-03 15:44:25 +02:00
3d49c959e0 Update DropFile to handle object versioning 2024-09-03 15:42:04 +02:00
nobohan
86896a12e6 Signature: download signed doc if signed 2024-09-03 11:25:05 +02:00
nobohan
3a959b7044 Signature app: rename userSignatureZones, remove zoneIndex, sign on click 2024-09-03 10:28:41 +02:00
nobohan
f8d95384ea Signature: action buttons positions 2024-09-02 18:05:12 +02:00
b6edbb3eed Refactor StoredObject normalization handling
Deprecate and remove specific context constants from StoredObjectNormalizer. Update object properties for better clarity and add permissions handling. Introduce related tests and adjust other files relying on the old context constants.
2024-08-28 23:19:24 +02:00
00cc3b7806 Refactor backend for getting signed url 2024-08-28 18:00:20 +02:00
7ab52ff09e Add stored object creation endpoint
Introduced a new API endpoint to create stored objects with access control for roles 'ROLE_ADMIN' and 'ROLE_USER'. Updated corresponding routes, removed unused dependencies, and added unit tests to ensure functionality.
2024-08-28 15:34:42 +02:00
2d82c1e105 rector fixes after rector's upgrade 2024-08-28 15:34:13 +02:00
e477a49c92 Integrate SwaggerUI with direct download and cleanup package
Added a customized SwaggerUI HTML template under Dev directory. Removed outdated swagger-ui dependency from package.json to streamline dependency management.
2024-08-28 15:26:19 +02:00
0db2652f08 Add cron job for removing expired stored objects
Introduced `RemoveExpiredStoredObjectCronJob` to automate the deletion of expired stored objects every 7 days. Enhanced associated tests and updated relevant interfaces and classes to support the new cron job functionality.
2024-08-28 14:06:11 +02:00
c38f7c1179 Add functionality to delete old versions of documents
This commit introduces a feature that automatically deletes old versions of StoredObjects in the Chill application. A cron job, "RemoveOldVersionCronJob", has been implemented to delete versions older than 90 days. A message handler, "RemoveOldVersionMessageHandler", has been added to handle deletion requests. Furthermore, unit tests for the new functionality have been provided.
2024-08-28 14:06:10 +02:00
67d24cb951 Use "createdAt" from database to compute the last modified datetime in StoredObjectManager
The code has been updated to use 'createdAt' from StoredObjectVersion entity in StoredObjectManager. Specifically, if a 'createdAt' datetime is set, we return that datetime. This change also includes corresponding test cases to validate the functionality. The situation helps deal with files created before July 2024.
2024-08-28 14:06:09 +02:00
cb90261309 Update random_bytes length in filename and prefix generation
The size of the random byte string used in the generateFilename method of StoredObjectVersion has been reduced from 16 to 8. Conversely, the size of the random byte string used in the generatePrefix method of StoredObject has been increased from 8 to 32.

The naming generation fit better with the usage, as 16bytes are generated for each file (more version), and less for the version.
2024-08-28 14:06:09 +02:00
2feea24c41 Add Collabora configuration guide and NullProofValidator class
A new document detailing the configuration steps for enabling Collabora in development has been added. This includes setting up ngrok and configuring both the Collabora and Symfony servers. Furthermore, a new class, NullProofValidator, has been created for validation during the development process. This class always returns true, making it useful for debugging purposes.
2024-08-28 14:06:08 +02:00
1b16d4fe3b Flush entities when storing document using webdav / put operation
The WebdavController has been updated to flush the EntityManager after writing a document, while its tests have been adjusted correspondingly. A new test for the document PUT operation has also been added, which ensures the EntityManager flushes and the StoredObjectManager writes to this document.
2024-08-28 14:06:08 +02:00
ce5659219a Fix test 2024-08-28 14:06:07 +02:00
5fefe09a39 Fix test 2024-08-28 14:06:07 +02:00
e21db73b84 Refactor and simplify document management functionality to adapt to StoredObject versioning
This commit includes several updates to the document management functionality within ChillWopiBundle and ChillDocGeneratorBundle, refactoring for simplicity and improved readability.
2024-08-28 14:06:07 +02:00
3978ea9a47 Update StoredObjectManager to handle versioned StoredObjects
The StoredObjectManager and related test cases have been updated to handle versioned StoredObjects, allowing the same methods to work with either a StoredObject or its versions. The changes also involve return information for the write method and enhancements to the write test procedure. This provides more functionality and flexibility for handling StoredObjects in different versions.
2024-08-28 14:06:06 +02:00
4fbb7811ac Refactor StoredObjectDataMapper to use registerVersion method
Removed saveHistory and set methods in StoredObjectDataMapper and replaced them with one call to registerVersion.
2024-08-28 14:06:06 +02:00
2b7ea4178b Add versioning to stored objects
This update introduces a versioning system to the stored objects in the ChillDocStoreBundle. The 'StoredObject' entity now includes several new methods, and maintains a collection of 'StoredObjectVersion' instances. Each time a 'StoredObject' is modified, a new version instance is created and added to the collection, ensuring a history of changes. Migration file for the addition of new database column included. Corresponding tests are also updated.
2024-08-28 14:06:06 +02:00
8a374864fa update code style after upgrade rector and phpstan 2024-08-28 14:03:26 +02:00
bb848746d5 Merge branch 'upgrade-sf5' into signature-app-master 2024-08-28 13:23:12 +02:00
3738c110f8 Add missing import 2024-08-28 12:38:11 +02:00
f57fdb2b4c Add missing import 2024-08-28 12:32:19 +02:00
b57824fc7e Update Rector skip configuration
Replaced Symfony Rector rules with Doctrine rule in the skip list due to a known issue. Refer to the linked GitHub issue for more details on the bug.
2024-08-28 12:21:43 +02:00
6b4e1ed2d3 PHP CS Fixer updated (3.59.3 -> v3.63.1) 2024-08-28 12:06:08 +02:00
b0485dbcc8 Replace ArrayCollection with Collection&Selectable on some entity typing (fix previous commit)
Updated entity properties to use Collection&Selectable for better type safety and interoperability. This change affects User, Household, Calendar, Person, AccompanyingPeriod, and EntityWorkflow classes.
2024-08-28 12:04:43 +02:00
c16219dc6d Force typing for ArrayIterator in EntityWorkflow 2024-08-28 11:48:24 +02:00
ad47804c91 Apply rector changes to Collection typing 2024-08-27 16:23:08 +02:00
85e2466611 Cherry-pick phpstan fixes after rector changes 2024-08-27 16:09:12 +02:00
94d6b5eff8 Merge branch 'upgrade-sf5' of gitlab.com:Chill-Projet/chill-bundles into upgrade-sf5 2024-08-26 18:15:13 +02:00
d87f380f16 Update chill bundles to version 3.0.0 2024-08-26 18:14:48 +02:00
58bf722fae remove the "v" prefix for file, to create release with tags starting with "v". 2024-08-26 14:21:43 +00:00
50fb79ebbf Remove enforcement of https scheme within controller method 2024-08-26 15:42:28 +02:00
58912f1d98 Add changie for fixes to CollectionType js 2024-08-22 14:24:58 +02:00
9604ba5f4b Merge branch 'person_resource_abstract_class' into 'upgrade-sf5'
Create abstract class for person resource and corrections made to CollectionType js

See merge request Chill-Projet/chill-bundles!716
2024-08-22 12:22:52 +00:00
b689a51a48 Changie added for fix connection to azure 2024-08-21 16:56:05 +02:00
8c0d2f58ba Add missing [ ] for schemes option 2024-08-21 16:53:26 +02:00
212230448b Add changie for fix of delete action accompanying periods 2024-08-21 15:14:48 +02:00
2bfb8fe387 Fix delete action for accompanying periods, missed in previous correction 2024-08-21 15:13:18 +02:00
6362b98a00 Specifiy https scheme for the connectAzureCheck controller method 2024-08-21 14:20:37 +02:00
6e2a08cae8 Resolve multiple entries not being saved in collectiontype 2024-08-21 10:22:13 +02:00
305105faae Fix CalendarContextTest after faulty php cs fix 2024-08-14 15:27:00 +02:00
85811cc6ae Run php-cs-fixer and rector 2024-08-14 14:45:59 +02:00
7eee995627 Merge branch 'upgrade-sf5' into person_resource_abstract_class 2024-08-14 14:26:24 +02:00
c0c448fb39 Remove dump from code 2024-08-14 14:26:04 +02:00
6445342136 Fix remove button not showing in CollectionType forms with allow_delete option 2024-08-14 14:23:03 +02:00
d52e54fd2a Make loadDynamicPicker available within windows where dynamicPicker tags are added 2024-08-14 13:38:58 +02:00
2f9884072c Add missing use statement for Groups annotation 2024-07-31 15:12:36 +02:00
ee45ff61a6 Reorganize person resource code to create an abstract class 2024-07-31 14:55:35 +02:00
564813ef3d Change attribute in test and add new test method
Updated an existing test to use the 'EDIT' attribute instead of 'SEE' in AbstractStoredObjectVoterTest.php. Added a new test method to check the 'SEE' attribute when the workflow is allowed, ensuring proper access validation.
2024-07-26 00:34:11 +02:00
5fed42a623 Fix decision logic in AbstractStoredObjectVoter
Amend the condition to ensure proper attribute validation before checking workflow association. This prevents unintended execution paths and potential exceptions when the workflow document service is not provided.
2024-07-25 23:34:36 +02:00
b19dd4fc11 Merge branch '292-signature-form-workflow' into 'signature-app-master'
Modify workflow form to indicate if signatures are wanted

See merge request Chill-Projet/chill-bundles!713
2024-07-24 11:09:07 +00:00
44226d6f7f Fix the config's path to workflow signature
- typo
- load the config's array instead of the path to the config
2024-07-24 13:07:47 +02:00
d75607a1d2 Php cs fixes 2024-07-24 12:00:10 +02:00
bf66af0f25 Fix configuration of workflow signature document kinds 2024-07-24 11:54:07 +02:00
15f3e474a0 Remove trailing end() in MainBundle configuration 2024-07-24 11:32:08 +02:00
5623cf946e Set empty_data option to allow empty array to be passed 2024-07-24 11:12:41 +02:00
0a6f3a99da Fix functioning of show hide 2024-07-23 19:59:10 +02:00
50bd9f32c3 Fix merge conflict in show-hide file 2024-07-23 16:23:51 +02:00
1396304af5 Change funtioning of showHide (wip) 2024-07-23 16:20:27 +02:00
c33e4adeec Adjust implementation of showHide (wip) 2024-07-23 12:37:16 +02:00
7351a35c42 Use better namespacing for configuring workflow signature documents 2024-07-23 12:37:16 +02:00
72e3325626 Implement show and hide logic within workflow form 2024-07-23 12:37:16 +02:00
0a46b5304d Adjust implementation of showHide (wip) 2024-07-23 12:18:14 +02:00
nobohan
e57d52d00e Update vue-toast-notification and use in signature app 2024-07-23 10:04:25 +02:00
64e527672d Merge branch 'signature-app-vueapp' into 'signature-app-master'
Signature app vueapp

See merge request Chill-Projet/chill-bundles!714
2024-07-22 21:43:04 +00:00
123168a5ee Effectively process signature request
The processSignature method in SignatureRequestController has been cleaned up and unneeded comments were removed. The process now involves retrieving the EntityWorkflow and StoredObject from the Signature, and reading the content from the StoredObjectManager. Debugging dump functions and commented code were also removed for a cleaner look.
2024-07-22 23:40:38 +02:00
3836d0dc9b Update PdfSignedMessageHandler to manage signature state
Additional dependencies have been added to the PdfSignedMessageHandler to handle the state of the signature. After writing the signed message content, the state is set to 'signed' and the state date is updated with the current time. Also, modifications are flushed in the EntityManager to save these changes to the database. Corresponding updates and tests have been made in the PdfSignedMessageHandlerTest file.
2024-07-22 23:40:10 +02:00
51ab4bef38 Improve rendering for signature zone 2024-07-22 23:06:49 +02:00
nobohan
567ca8a26f integrate signature vueapp to workflow 2024-07-19 11:42:08 +02:00
nobohan
111305d09c DX change function names to camelCase format in vue app signature 2024-07-19 10:00:16 +02:00
nobohan
67395f52b5 signature: fix cs + test PDFParser 2024-07-18 17:16:21 +02:00
nobohan
421226c0dc signature: check for signature state 2024-07-18 17:16:20 +02:00
nobohan
77da2c1ac6 signature: add index on PDFSignatureZone + init POST signature 2024-07-18 17:16:20 +02:00
nobohan
39d3ba2f40 signature: fake POSTing of signature, adjustments 2024-07-18 17:16:20 +02:00
nobohan
fb62e54d63 signature: correct positioning of zones in vue app wrt to PDFSignatureZoneParser 2024-07-18 17:16:19 +02:00
nobohan
c968d6c541 signature: improve layout and some functionalities of the signature app 2024-07-18 17:16:19 +02:00
nobohan
c428e6665f signature: use PDFSignatureZoneParser in vue app signature 2024-07-18 17:16:19 +02:00
nobohan
5b7e3f0336 signature - modale and translations in the vue app 2024-07-18 17:16:19 +02:00
nobohan
0c8ef37860 signature - more css bootstrap layout of the signature vue app 2024-07-18 17:16:19 +02:00
nobohan
794c479b9e signature: layout and css bootstrap class of the vue app 2024-07-18 17:16:19 +02:00
nobohan
1bee3114ac signature: improve signature vue app 2024-07-18 17:16:19 +02:00
nobohan
1344b65dd4 signature: fix using of window variable 2024-07-18 17:16:19 +02:00
nobohan
68dcf4dd28 signature: confirm signature and undo buttons 2024-07-18 17:16:19 +02:00
nobohan
b0a8fd54a8 signature: fully working app with pdfjs-dist 2024-07-18 17:16:19 +02:00
nobohan
0f589ec57e signature: POC of showing PDF with pdfjs-dist 2024-07-18 17:16:19 +02:00
nobohan
2d4fc45a0c signature: manage multi-pages doc 2024-07-18 17:16:19 +02:00
nobohan
c80f23f0db signature: scale the signature zone to the canvas dimension 2024-07-18 17:16:18 +02:00
nobohan
c950400fe2 signature: POC of drawing signature zones and click event on canvas 2024-07-18 17:16:18 +02:00
nobohan
21c1e77d36 signature: POC of showing a pdf with vue-pdf-embed 2024-07-18 17:16:18 +02:00
nobohan
bbfd0caf10 signature: download storedObject document in the vuejs app 2024-07-18 17:16:18 +02:00
nobohan
9192883217 ADDED bootstrap signature vue app 2024-07-18 17:16:18 +02:00
3836622d27 Use better namespacing for configuring workflow signature documents 2024-07-18 16:03:45 +02:00
cc2c4be1b0 Merge branch '288-signature-zone-workflow' into 'signature-app-master'
Signature zone within workflow

See merge request Chill-Projet/chill-bundles!708
2024-07-18 13:51:08 +00:00
873940786f Signature zone within workflow 2024-07-18 13:51:08 +00:00
db73dcffc7 Merge branch '286-storedobject-voter' into 'signature-app-master'
Adjust behavoir of voters for stored objects

See merge request Chill-Projet/chill-bundles!701
2024-07-16 12:01:28 +00:00
8aec69f0f9 Merge remote-tracking branch 'origin/signature-app-master' into 286-storedobject-voter 2024-07-16 13:34:36 +02:00
9f88eef249 Fix permission logic in StoredObjectNormalizer
The logic for checking 'see' and 'edit' permissions within the StoredObjectNormalizer has been updated. It now correctly refers to the value of the StoredObjectRoleEnum to check access rights.
2024-07-16 13:24:46 +02:00
d689ce9aef Fix condition for checking if the user is allowed to edit a document attached to a workflow 2024-07-16 13:24:45 +02:00
d5e4991982 Rename WorkflowDocumentService to WorkflowStoredObjectPermissionHelper
The previous name, WorkflowDocumentService, was misleading as its functionality extends to all stored objects and not limited to documents. Therefore, it was renamed to WorkflowStoredObjectPermissionHelper. Consequently, all references to this service were updated throughout the codebase.
2024-07-16 13:24:45 +02:00
ca68b58246 Move classes to dedicated bundle, and avoid plural for namespace name 2024-07-15 21:22:31 +02:00
747a1de321 Add locale requirement to search route, to avoid conflict with profiler route
Introduces a locale requirement to the search route in the ChillMainBundle. This update specifies that a valid locale should consist of 1 to 3 lowercase alphabetic characters. This change will help constrain acceptable locale values.
2024-07-15 21:22:30 +02:00
9e92ede16f Handle cases when there are multiple EntityWorkflows associated with one entity 2024-07-15 21:22:30 +02:00
31f842471a Refactor authorization for AccompanyingPeriodWorkEvaluationDocuments
The AccompanyingPeriodWorkEvaluationStoredObjectVoter has been updated to use the AccompanyingPeriodWorkEvaluationDocument-related classes instead of the AccompanyingPeriodWork classes. Additionally, a new voters class, AccompanyingPeriodWorkEvaluationDocumentVoter has been created. Changes are also made in the repository to find the associated entity in the AccompanyingPeriodWorkEvaluationDocument repository instead of the AccompanyingPeriodWork repository.
2024-07-15 21:22:30 +02:00
7d0f9175be Refactor StoredObjectVoterTest to improve testing logic
The existing StoredObjectVoter test logic was reworked to utilize UsernamePasswordToken and Security mock objects instead of defining its own token. This change improves the testing for different scenarios such as unsupported attributes and cases where role voters cannot see the stored object. Also, the redundancy in the test case provider was removed, which leads to cleaner and more maintainable code.
2024-07-15 17:18:28 +02:00
e83307ca6d Remove obsolete security checks in StoredObjectVoter
This commit eliminates antiquated security checks in the StoredObjectVoter class. Specifically, it removes a chunk of commented out code that checked for certain attributes on the token and also the import for DavTokenAuthenticationEventSubscriber class which is no longer needed. This results in code cleanup and prevents future confusion.
2024-07-15 17:17:56 +02:00
215eba41b7 Fix unit test to accomodate changed constructor in StoredObjectNormalizer 2024-07-11 15:52:47 +02:00
52a3d1be1b Implement show and hide logic within workflow form 2024-07-11 15:16:40 +02:00
8d543be5cc Add configuration on id_document_types to avoid errors 2024-07-11 15:15:04 +02:00
0474b25859 Merge branch 'signature-app/signatur-for-user' into 'signature-app-master'
Add support for user signatures in workflow transitions

See merge request Chill-Projet/chill-bundles!712
2024-07-10 10:52:48 +00:00
db94af0958 Add support for user signatures in workflow transitions
This update introduces the ability to specify user signatures in workflow transitions. It allows a nullable user to be declared that may be requested to apply a signature. The code now handles the use-case of signing a transition by a user in addition to previous functionality of having it signed by a "Person" entity. Corresponding tests are also updated to validate this new feature.
2024-07-10 12:47:02 +02:00
3e8805bdda Merge branch 'signature-app/get-stored-object-from-workflow' into 'signature-app-master'
Allow to retrieve an eventual stored object associated with an EntityWorkflow + handle more effectively transition

See merge request Chill-Projet/chill-bundles!711
2024-07-10 08:45:22 +00:00
a887602f4f Handle storing of new object in PdfSignedMessageHandler
The PdfSignedMessageHandler has been updated to handle pdf signed messages: the content is now stored within the object. Also, a PdfSignedMessageHandlerTest has been created to ensure the correct functionality of the updated handler.
2024-07-10 10:40:19 +02:00
c1cf27c42d Refactor workflow handlers and update comments
Changes include class refactoring for Workflow handlers, using `readonly` and better indentation in constructors for better readability. In addition, outdated comments are removed. Also, entity workflow handlers now implement the EntityWorkflowHandlerInterface type for better type safety.
2024-07-10 10:40:18 +02:00
fe6b4848e6 Implement workflow handlers for stored objects
Added new interface, EntityWorkflowWithStoredObjectHandlerInterface, which provides methods to handle workflows associated with stored objects. Two classes, AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler and AccompanyingCourseDocumentWorkflowHandler, have been updated to implement this new interface. The EntityWorkflowManager class has also been updated to handle workflows associated with stored objects.
2024-07-10 10:40:18 +02:00
b5af9f7b63 Add futurePersonSignatures property to WorkflowTransitionContextDTO
A new property named futurePersonSignatures has been added to the WorkflowTransitionContextDTO class. This will hold a list of Person objects expected to sign the next step, improving the scope of information available within the workflow context.
2024-07-10 10:40:18 +02:00
7f3de62b2c Move the metadata on each workflow transition from the event subscriber to the entity EntityWorkflow::setStep method
The main update is in the setStep method of EntityWorkflow, where parameters are added to capture the transition details. These include the exact transition, the user who made the transition and the time of transition.

The WorkflowController extracts this information and put it into the transition's context. The MarkingStore transfer it to the EntityWorkflow::setStep method, and all metadata are recorded within the entities themselve.
2024-07-10 10:40:17 +02:00
cfa51cd659 php cs fixer 2024-07-09 15:43:22 +02:00
facc4affed Fix testNormalizerSignedUrl method fixed 2024-07-09 14:57:14 +02:00
f9122341d1 Fix phpstan error in match() function 2024-07-09 13:30:58 +02:00
7dd5f542a6 Fix serialization of SignedUrl
An annotation was missing to include the object_name in the serialization.
2024-07-04 16:28:09 +02:00
3b80d9a93b Delete voters that are not in use anymore 2024-07-04 16:24:53 +02:00
790576863f Merge signature-app-master into branch 2024-07-04 15:53:01 +02:00
25e89571f7 Change usage of match function in AsyncUploadVoter 2024-07-04 15:48:08 +02:00
435836c7d1 Delete unused storedobject voter 2024-07-04 15:46:18 +02:00
af4db22184 php cs fixer and rector: add missing comma in AsyncUploadControllerTest 2024-07-04 13:58:10 +02:00
2adc8b3bf6 Fix construct of SignedUrlPost 2024-07-04 12:03:43 +02:00
21b79c1981 Php cs fixes 2024-07-04 11:39:02 +02:00
428494ca1f Implement stored object permissions in serialization 2024-07-04 11:38:41 +02:00
5d57ec8a3b Complete AbstractStoredObjectVoterTest.php 2024-07-04 11:38:13 +02:00
719fabc878 Check permissions within StoredObjectNormalizer.php 2024-07-04 11:27:54 +02:00
e9a9a3430f Complete AbstractStoredObjectVoterTest.php 2024-07-04 11:27:16 +02:00
c648a560cc Fix merge conflict in AuthorizationManager 2024-07-02 15:51:51 +02:00
3d7c8596ee Pass StoredObject instead of Document to check permission in AuthorizationManager.php 2024-07-02 15:49:53 +02:00
345f379650 Implement StoredObject permissions WOPI AuthorizationManager.php 2024-07-02 15:39:31 +02:00
3262a1dd02 Implement StoredObject permissions in AsyncUploadVoter.php 2024-07-02 15:39:06 +02:00
a9f4f8c973 Resolve phpstan erorrs 2024-07-02 14:17:05 +02:00
c19c597ba0 Fix checking of permissions within document_button_group 2024-07-02 12:50:44 +02:00
03800029c9 Fix the import of StoredObjectVoterInterface 2024-07-02 12:49:29 +02:00
064dfc5a56 Fix repositories to fetch entity linked to stored object
getSingleResult() replaced by getOneOrNullResult() to\ avoid error being thrown.
Fix naming of properties.
2024-07-02 12:48:32 +02:00
ba95687f46 Merge branch 'signature-app/signature-doctrine-model' into 'signature-app-master'
Create entity workflow signature

See merge request Chill-Projet/chill-bundles!705
2024-07-02 06:35:23 +00:00
a309cc0774 Refactor workflow classes and forms
- the workflow controller add a context to each transition;
- the state of the entity workflow is applyied using a dedicated marking store
- the method EntityWorkflow::step use the context to associate the new step with the future destination user, cc users and email. This makes the step consistent at every step.
- this allow to remove some logic which was processed in eventSubscribers,
- as counterpart, each workflow must specify a dedicated marking_store:

```yaml
framework:
    workflows:
        vendee_internal:
            # ...
            marking_store:
                service: Chill\MainBundle\Workflow\EntityWorkflowMarkingStore
```
2024-07-02 08:30:28 +02:00
5b0babb9b0 Implement permissions in AsyncUploadVoter.php 2024-07-01 15:37:47 +02:00
ac2f314395 Implement permissions for download button group 2024-07-01 15:23:32 +02:00
8c92d11722 Implement permissions for WOPI 2024-07-01 15:23:07 +02:00
3db4fff80d Add signature functionality to workflow entities
Created new files to add signature functionality to the workflow entities, including signature state enums and signature metadata. Added these changes to the migration script as well. Updated EntityWorkflowStep to include a collection for signatures.
2024-07-01 14:50:03 +02:00
fb743b522d Remove implementation of StoredObjectInterface 2024-07-01 12:23:31 +02:00
d1653a074b Implement test on AbstractStoredObjectVoter
To avoid having to duplicate tests, a test is written\
for the abstract voter.
2024-07-01 12:21:25 +02:00
254122d125 Remove check to see if user is instance of User
The admin user would not be identified as a User.
2024-07-01 12:20:21 +02:00
c9d2e37cee Implement logic to check if editing of document is blocked by workflow
Using the workflow handlers we return the workflow that is attached to an object
so that within the workflowDocumentService we can then check whether this workflow blocks
the edition of a document.
2024-07-01 12:14:03 +02:00
c9d54a5fea fix cs 2024-06-28 10:47:12 +02:00
86c862e69d Merge remote-tracking branch 'origin/upgrade-sf5' into signature-app-master 2024-06-28 10:41:52 +02:00
9bc6fe6aff Add PdfSignedMessage and its serializer
Added a new class, PdfSignedMessage, to handle received signed PDF messages. Also, added a serializer for this class, PdfSignedMessageSerializer, for use with messaging. Furthermore, comment documentation has been added to RequestPdfSignMessage and its serializer for better clarity. Updated unit tests are also included.
2024-06-27 21:52:24 +02:00
18a03fd740 Add signature messenger request serialization and processing
This update introduces a new serializer class for request messages (from messenger component). New features-includes encoding and decoding of request messages and handling unexpected value exceptions. A new test class for the serializer and it also adds functionality to process signature requests in the controller.
2024-06-27 13:38:19 +02:00
e9d4b9e2ab Resolve merge conflicts 2024-06-27 12:50:16 +02:00
efaad1981d Fix namespaces and move voters to corresponding bundles 2024-06-27 12:44:36 +02:00
742f2540f6 Setup AccompanyingPeriodWorkEvaluationStoredObjectVoter.php to use AccompanyingPeriodWorkRepository.php
The voter was not checking the correct permissions to\ establish whether a user can see/edit a storedObject\
The right to see/edit an AccompanyingPeriodWork has to\
be checked.
2024-06-27 11:59:31 +02:00
bab6528ed6 Add test for AccompayingCourseStoredObjectVoter
Mainly to check the voteOnAttribute method, by mocking a scenario where a person
is allowed to see/edit an AccompanyingCourseDocument and not.
2024-06-27 11:31:39 +02:00
a25f2c7539 Ensure single result when retrieving activity and event linked to stored object
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
2024-06-27 11:31:39 +02:00
c06e76a0ee Implement context-specific voters for all current entities that can be linked to a document
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
2024-06-27 11:31:39 +02:00
4607c36b57 Add WorkflowDocumentService and use in StoredObject voters
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
2024-06-27 11:31:39 +02:00
7c03a25f1a Refactor AccompanyingCourseDocumentRepository.php
Build where clause using StoredObject directly instead\
of based on it's id.
2024-06-27 11:31:39 +02:00
cce04ee490 Remove implementation of StoredObjectVoterInterface in AccompanyingCourseDocumentVoter.php
This implementation has been moved to the voter\ AccompanyingCourseDocumentStoredObjectVoter.php
2024-06-27 11:31:39 +02:00
e54633d14d Implement voting logic: separation of concerns
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
2024-06-27 11:31:39 +02:00
d9892f6822 Correct namespace and use statement for StoredObjectVoterInterface.php
The namespace was formed wrong and needed adjustment
2024-06-27 11:31:39 +02:00
f75c7a0232 Implement StoredObjectVoterInterface
An interface was created to be implemented by Stored Doc voters\
these will automatically be tagged and injected into DocStoreVoter.
2024-06-27 11:31:39 +02:00
062afd6695 Use service tags to inject all voters into StoredObjectVoter.php
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
2024-06-27 11:31:39 +02:00
830dace1ba Rename voter.yaml file to security.yaml
For consistency with other bundles voters are\
registered under the security.yaml file.
2024-06-27 11:31:39 +02:00
2ce9810243 Use constructor property promotion
In accordance with php8.1 use property promotion\
within the constructor method. Less clutter.
2024-06-27 11:31:39 +02:00
26b3d84d62 Add fall-back right for ROLE_ADMIN
Within the StoredObjectVoter.php also the admin\
user should be able to edit documents as a fall-back
2024-06-27 11:31:39 +02:00
30078db841 Type-hint $subject in StoredObjectVoterInterface.php
Since the subject passed to these voters should\
always be of the type StoredObject, type-hinting\ added.
2024-06-27 11:31:39 +02:00
aaac80be84 Add config voter.yaml
The voter.yaml was not configured to be taken into account. Now added\
to ChillDocStoreExtension.php
2024-06-27 11:31:39 +02:00
a0fead48e1 Refactorize StoredObjectVoter.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
2024-06-27 11:31:39 +02:00
2d09efb2e0 Add StoredObjectVoterInterface
An interface is defined that can be implemented by each context-specific voter in the future.
2024-06-27 11:31:39 +02:00
3a87513a11 initial commit 2024-06-27 11:31:39 +02:00
d3956319ca Add test for AccompayingCourseStoredObjectVoter
Mainly to check the voteOnAttribute method, by mocking a scenario where a person
is allowed to see/edit an AccompanyingCourseDocument and not.
2024-06-26 15:39:58 +02:00
bd36735cb1 Ensure single result when retrieving activity and event linked to stored object
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
2024-06-26 14:06:02 +02:00
1310d53589 Implement context-specific voters for all current entities that can be linked to a document
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
2024-06-26 14:04:08 +02:00
610239930b Add serialization groups to PDFPage and PDFSignatureZone properties
The Symfony Serializer groups annotation has been added to all properties of the PDFPage and PDFSignatureZone classes. This change allows the serialization and deserialization process to be group-specific, ensuring only relevant data is processed during these operations.
2024-06-25 13:43:48 +02:00
b65e2c62c4 Merge branch 'signature-app/parse-pdf' into 'signature-app-master'
Add PDF signature zone parsing functionality

See merge request Chill-Projet/chill-bundles!703
2024-06-25 11:27:34 +00:00
89f5231649 Refactor PDFSignatureZoneParser to use float values
This update changes how we handle values in PDFSignatureZoneParser class. Specifically, we've modified the 'MediaBox' and 'PDFSignatureZone' variables to use float values. The helps ensure greater precision, minimize errors, and maintain data consistency across the application.
2024-06-25 13:25:49 +02:00
73797b98f6 Add WorkflowDocumentService and use in StoredObject voters
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
2024-06-20 17:32:09 +02:00
3d40db7493 Refactor AccompanyingCourseDocumentRepository.php
Build where clause using StoredObject directly instead\
of based on it's id.
2024-06-20 17:28:19 +02:00
760d65b972 Remove implementation of StoredObjectVoterInterface in AccompanyingCourseDocumentVoter.php
This implementation has been moved to the voter\ AccompanyingCourseDocumentStoredObjectVoter.php
2024-06-20 17:27:21 +02:00
d26fa6bde6 Implement voting logic: separation of concerns
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
2024-06-20 15:18:26 +02:00
427f232ab8 Correct namespace and use statement for StoredObjectVoterInterface.php
The namespace was formed wrong and needed adjustment
2024-06-20 10:53:33 +02:00
99818c211d Fix cs: upgrade of php-cs-fixer 2024-06-19 12:18:20 +02:00
a9f0059743 Add PDF signature zone parsing functionality
This update introduces new services into the ChillDocStoreBundle for signature zone parsing within PDFs. The PDFSignatureZoneParser service identifies signature zones within PDF content while the additional classes, PDFPage and PDFSignatureZone, help define these zones and pages. Corresponding tests have also been
2024-06-19 12:17:25 +02:00
5bc542a567 remove symfony/phpunit-bridge 2024-06-19 12:16:51 +02:00
482f279dc5 Implement StoredObjectVoterInterface
An interface was created to be implemented by Stored Doc voters\
these will automatically be tagged and injected into DocStoreVoter.
2024-06-19 10:21:24 +02:00
e0828b1f0f Use service tags to inject all voters into StoredObjectVoter.php
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
2024-06-19 10:17:50 +02:00
e015f71bb0 Rename voter.yaml file to security.yaml
For consistency with other bundles voters are\
registered under the security.yaml file.
2024-06-19 10:02:25 +02:00
04a48f22ad Use constructor property promotion
In accordance with php8.1 use property promotion\
within the constructor method. Less clutter.
2024-06-19 10:00:10 +02:00
ad4fe80240 Add fall-back right for ROLE_ADMIN
Within the StoredObjectVoter.php also the admin\
user should be able to edit documents as a fall-back
2024-06-19 09:52:59 +02:00
4b82e67952 Type-hint $subject in StoredObjectVoterInterface.php
Since the subject passed to these voters should\
always be of the type StoredObject, type-hinting\ added.
2024-06-19 09:51:21 +02:00
c8ccce83fd add a dependency on smalot/pdfparser to parse signature zone within pdf 2024-06-18 17:47:16 +02:00
e9a9262fae Add config voter.yaml
The voter.yaml was not configured to be taken into account. Now added\
to ChillDocStoreExtension.php
2024-06-14 17:27:22 +02:00
d9e37d0958 Refactorize StoredObjectVoter.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
2024-06-14 17:25:24 +02:00
65c41e6fa9 Add StoredObjectVoterInterface
An interface is defined that can be implemented by each context-specific voter in the future.
2024-06-14 16:48:09 +02:00
7923b5a1ef initial commit 2024-06-14 15:35:50 +02:00
4a229ebf6b Initial commit 2024-06-14 15:32:51 +02:00
2059 changed files with 11262 additions and 9175 deletions

View File

@@ -0,0 +1,8 @@
kind: Feature
body: |-
Electronic signature
Implementation of the electronic signature for documents within chill.
time: 2024-06-14T15:32:36.875891692+02:00
custom:
Issue: ""

View File

@@ -0,0 +1,7 @@
kind: Feature
body: The behavoir of the voters for stored objects is adjusted so as to limit edit
and delete possibilities to users related to the activity, social action or workflow
entity.
time: 2024-06-14T15:35:37.582159301+02:00
custom:
Issue: "286"

View File

@@ -0,0 +1,5 @@
kind: Feature
body: Metadata form added for person signatures
time: 2024-07-18T15:12:33.8134266+02:00
custom:
Issue: "288"

5
.changes/v3.0.0.md Normal file
View File

@@ -0,0 +1,5 @@
## v3.0.0 - 2024-08-26
### Fixed
* Fix delete action for accompanying periods in draft state
* Fix connection to azure when making an calendar event in chill
* CollectionType js fixes for remove button and adding multiple entries

View File

@@ -122,7 +122,7 @@ unit_tests:
- php tests/console chill:db:sync-views --env=test
- php -d memory_limit=2G tests/console cache:clear --env=test
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n --env=test
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive,openstack-integration,collabora-integration
artifacts:
expire_in: 1 day
paths:
@@ -138,4 +138,4 @@ release:
- echo "running release_job"
release:
tag_name: '$CI_COMMIT_TAG'
description: "./.changes/v$CI_COMMIT_TAG.md"
description: "./.changes/$CI_COMMIT_TAG.md"

View File

@@ -6,6 +6,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v3.0.0 - 2024-08-26
### Fixed
* Fix delete action for accompanying periods in draft state
* Fix connection to azure when making an calendar event in chill
* CollectionType js fixes for remove button and adding multiple entries
## v2.23.0 - 2024-07-23
### Feature
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles

View File

@@ -8,7 +8,7 @@
"social worker"
],
"require": {
"php": "^8.3",
"php": "^8.2",
"ext-dom": "*",
"ext-json": "*",
"ext-openssl": "*",
@@ -30,48 +30,50 @@
"ovh/ovh": "^3.0",
"phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^6.0",
"sensio/framework-extra-bundle": "^5.5",
"smalot/pdfparser": "^2.10",
"spomky-labs/base64url": "^2.0",
"symfony/asset": "6.4.*",
"symfony/browser-kit": "6.4.*",
"symfony/cache": "6.4.*",
"symfony/asset": "^5.4",
"symfony/browser-kit": "^5.4",
"symfony/cache": "^5.4",
"symfony/clock": "^6.2",
"symfony/config": "^6.4",
"symfony/console": "6.4.*",
"symfony/css-selector": "6.4.*",
"symfony/dom-crawler": "6.4.*",
"symfony/error-handler": "6.4.*",
"symfony/event-dispatcher": "6.4.*",
"symfony/expression-language": "6.4.*",
"symfony/filesystem": "6.4.*",
"symfony/finder": "6.4.*",
"symfony/form": "6.4.*",
"symfony/framework-bundle": "6.4.*",
"symfony/http-client": "6.4.*",
"symfony/http-foundation": "6.4.*",
"symfony/intl": "6.4.*",
"symfony/mailer": "6.4.*",
"symfony/messenger": "6.4.*",
"symfony/mime": "6.4.*",
"symfony/config": "^5.4",
"symfony/console": "^5.4",
"symfony/css-selector": "^5.4",
"symfony/dom-crawler": "^5.4",
"symfony/error-handler": "^5.4",
"symfony/event-dispatcher": "^5.4",
"symfony/expression-language": "^5.4",
"symfony/filesystem": "^5.4",
"symfony/finder": "^5.4",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/http-client": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/intl": "^5.4",
"symfony/mailer": "^5.4",
"symfony/messenger": "^5.4",
"symfony/mime": "^5.4",
"symfony/monolog-bundle": "^3.5",
"symfony/options-resolver": "6.4.*",
"symfony/process": "6.4.*",
"symfony/property-access": "6.4.*",
"symfony/property-info": "6.4.*",
"symfony/routing": "6.4.*",
"symfony/security-bundle": "^6.4",
"symfony/security-core": "6.4.*",
"symfony/security-csrf": "6.4.*",
"symfony/security-http": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/string": "6.4.*",
"symfony/templating": "6.4.*",
"symfony/translation": "6.4.*",
"symfony/twig-bundle": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/options-resolver": "^5.4",
"symfony/process": "^5.4",
"symfony/property-access": "^5.4",
"symfony/property-info": "^5.4",
"symfony/routing": "^5.4",
"symfony/security-bundle": "^5.4",
"symfony/security-core": "^5.4",
"symfony/security-csrf": "^5.4",
"symfony/security-guard": "^5.4",
"symfony/security-http": "^5.4",
"symfony/serializer": "^5.4",
"symfony/string": "^5.4",
"symfony/templating": "^5.4",
"symfony/translation": "^5.4",
"symfony/twig-bundle": "^5.4",
"symfony/validator": "^5.4",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "6.4.*",
"symfony/yaml": "6.4.*",
"symfony/workflow": "^5.4",
"symfony/yaml": "^5.4",
"thenetworg/oauth2-azure": "^2.0",
"twig/extra-bundle": "^3.0",
"twig/intl-extra": "^3.0",
@@ -92,13 +94,13 @@
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^10.5.24",
"rector/rector": "^1.1.0",
"symfony/debug-bundle": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/debug-bundle": "^5.4",
"symfony/dotenv": "^5.4",
"symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^7.1",
"symfony/runtime": "6.4.*",
"symfony/stopwatch": "6.4.*",
"symfony/var-dumper": "6.4.*"
"symfony/runtime": "^5.4",
"symfony/stopwatch": "^5.4",
"symfony/var-dumper": "^5.4"
},
"conflict": {
"symfony/symfony": "*"
@@ -151,11 +153,5 @@
"cache:clear": "symfony-cmd"
},
"php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.4.*"
}
}
}

View File

@@ -21,7 +21,6 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
{
// add specific role for this filter
#[\Override]
public function addRole(): ?string
{
// we do not need any new role for this filter, so we return null
@@ -29,7 +28,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
}
// here, we alter the query created by Export
#[\Override]
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -54,14 +52,12 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
}
// we give information on which type of export this filter applies
#[\Override]
public function applyOn()
{
return 'person';
}
// we build a form to collect some parameters from the users
#[\Override]
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, [
@@ -78,7 +74,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
'format' => 'dd-MM-yyyy',
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return ['date_from' => new DateTime(), 'date_to' => new DateTime()];
@@ -86,7 +81,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
// here, we create a simple string which will describe the action of
// the filter in the Response
#[\Override]
public function describeAction($data, $format = 'string')
{
return ['Filtered by person\'s birtdate: '
@@ -96,7 +90,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
], ];
}
#[\Override]
public function getTitle()
{
return 'Filter by person\'s birthdate';
@@ -106,7 +99,6 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
// is executed here. This function is added by the interface
// `ExportElementValidatedInterface`, and can be ignore if there is
// no need for a validation
#[\Override]
public function validateForm($data, ExecutionContextInterface $context)
{
$date_from = $data['date_from'];

View File

@@ -32,30 +32,25 @@ class CountPerson implements ExportInterface
$this->entityManager = $em;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// this export does not add any form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription()
{
return 'Count peoples by various parameters.';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
// the Closure which will be executed by the formatter.
@@ -65,7 +60,6 @@ class CountPerson implements ExportInterface
};
}
#[\Override]
public function getQueryKeys($data)
{
// this array match the result keys in the query. We have only
@@ -73,25 +67,21 @@ class CountPerson implements ExportInterface
return ['export_result'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle()
{
return 'Count peoples';
}
#[\Override]
public function getType()
{
return Declarations::PERSON_TYPE;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// we gather all center the user choose.
@@ -108,13 +98,11 @@ class CountPerson implements ExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return PersonVoter::STATS;
}
#[\Override]
public function supportsModifiers()
{
// explain the export manager which formatters and filters are allowed

View File

@@ -31,7 +31,6 @@ class ChillMainConfiguration implements ConfigurationInterface
$this->setWidgetFactories($widgetFactories);
}
#[\Override]
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('chill_main');

View File

@@ -27,13 +27,11 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
*/
protected $widgetFactories = [];
#[\Override]
public function addWidgetFactory(WidgetFactoryInterface $factory)
{
$this->widgetFactories[] = $factory;
}
#[\Override]
public function getConfiguration(array $config, ContainerBuilder $container)
{
return new Configuration($this->widgetFactories, $container);
@@ -42,13 +40,11 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
/**
* @return WidgetFactoryInterface[]
*/
#[\Override]
public function getWidgetFactories()
{
return $this->widgetFactories;
}
#[\Override]
public function load(array $configs, ContainerBuilder $container)
{
// configuration for main bundle

View File

@@ -25,7 +25,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
* see http://symfony.com/doc/current/components/config/definition.html
*
*/
#[\Override]
public function configureOptions($place, NodeBuilder $node)
{
$node->booleanNode('only_active')
@@ -57,7 +56,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
* the service must exists in the container, and it is not required that the service
* has the `chill_main` tag.
*/
#[\Override]
public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config)
{
return 'chill_person.widget.person_list';
@@ -68,7 +66,6 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
*
* @return string
*/
#[\Override]
public function getWidgetAlias()
{
return 'person_list';

View File

@@ -79,7 +79,6 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
*
* @return string
*/
#[\Override]
public function render(Twig_Environment $env, $place, array $context, array $config)
{
$qb = $this->personRepository

View File

@@ -22,7 +22,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class ChillPersonExtension extends Extension implements PrependExtensionInterface
{
#[\Override]
public function load(array $configs, ContainerBuilder $container)
{
// ...
@@ -33,7 +32,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
*
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
*/
#[\Override]
public function prepend(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [

View File

@@ -0,0 +1,125 @@
Enable CODE for development
===========================
For editing a document, there must be a way to communicate between the collabora server and the symfony server, in
both direction. The domain name should also be the same for collabora server and for the browser which access to the
online editor.
Using ngrok (or other http tunnel)
----------------------------------
One can configure a tunnel server to expose your local install to the web, and access to your local server using the
tunnel url.
Start ngrok
^^^^^^^^^^^
This can be achieve using `ngrok <https://ngrok.com/>`_.
.. note::
The configuration of ngrok is outside of the scope of this document. Refers to the ngrok's documentation.
.. code-block:: bash
# ensuring that your server is running through http and port 8000
ngrok http 8000
# then open the link given by the ngrok utility and you should reach your app
At this step, ensure that you can reach your local app using the ngrok url.
Configure Collabora
^^^^^^^^^^^^^^^^^^^
The collabora server must be executed online and configure to access to your ngrok installation. Ensure that the aliasgroup
exists for your ngrok application (`See the CODE documentation: <https://sdk.collaboraonline.com/docs/installation/Configuration.html#multihost-configuration>`_).
Configure your app
^^^^^^^^^^^^^^^^^^
Set the :code:`EDITOR_SERVER` variable to point to your collabora server, this should be done in your :code:`.env.local` file.
At this point, everything must be fine. In case of errors, watch the log from your collabora server, use the `profiler <https://symfony.com/doc/current/profiler.html>`_
to debug the requests.
.. note::
In case of error while validating proof (you'll see those message in the collabora's logs), you can temporarily disable
the proof validation adding this code snippet in `config/services.yaml`:
.. code-block:: yaml
when@dev:
# add only in dev environment, to avoid security problems
services:
ChampsLibres\WopiLib\Contract\Service\ProofValidatorInterface:
# this class will always validate proof
alias: Chill\WopiBundle\Service\Wopi\NullProofValidator
With a local CODE image
-----------------------
.. warning::
This configuration is not sure, and must be refined. The documentation does not seems to be entirely valid.
Use a local domain name and https for your app
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use the proxy feature from embedded symfony server to run your app. `See the dedicated doc <https://symfony.com/doc/current/setup/symfony_server.html#local-domain-names>`
Configure also the `https certificate <https://symfony.com/doc/current/setup/symfony_server.html#enabling-tls>`_
In this example, your local domain name will be :code:`my-domain` and the url will be :code:`https://my-domain.wip`.
Ensure that the proxy is running.
Create a certificate database for collabora
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Collabora must validate your certificate generated by symfony console. For that, you need `to create a NSS database <https://sdk.collaboraonline.com/docs/installation/Configuration.html#validating-digital-signatures>`
and configure collabora to use it.
At first, export the certificate for symfony development. Use the graphical interface from your browser to get the
certificate as a PEM file.
.. code-block:: bash
# create your database in a custom directory
mkdir /path/to/your/directory
certutil -N -d /path/to/your/directory
cat /path/to/your/ca.crt | certutil -d . -A symfony -t -t C,P,C,u,w -a
Launch CODE properly configured
.. code-block:: yaml
collabora:
image: collabora/code:latest
environment:
- SLEEPFORDEBUGGER=0
- DONT_GEN_SSL_CERT="True"
# add path to the database
- extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:logging.level=7 -o:certificates.database_path=/etc/custom-certificates/nss-database
- username=admin
- password=admin
- dictionaries=en_US
- aliasgroup1=https://my-domain.wip
ports:
- "127.0.0.1:9980:9980"
volumes:
- "/path/to/your/directory/nss-database:/etc/custom-certificates/nss-database"
extra_hosts:
- "my-domain.wip:host-gateway"
Configure your app
^^^^^^^^^^^^^^^^^^
Into your :code:`.env.local` file:
.. code-block:: env
EDITOR_SERVER=http://${COLLABORA_HOST}:${COLLABORA_PORT}
At this step, you should be able to edit a document through collabora.

View File

@@ -53,7 +53,7 @@
"marked": "^12.0.2",
"masonry-layout": "^4.2.2",
"mime": "^4.0.0",
"swagger-ui": "^4.15.5",
"pdfjs-dist": "^4.3.136",
"vis-network": "^9.1.0",
"vue": "^3.2.37",
"vue-i18n": "^9.1.6",

View File

@@ -39,19 +39,14 @@ return static function (RectorConfig $rectorConfig): void {
//define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_83,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_40,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_41,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
// \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
// \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
LevelSetList::UP_TO_PHP_82,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_40,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_41,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
]);
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
@@ -74,9 +69,8 @@ return static function (RectorConfig $rectorConfig): void {
// skip some path...
$rectorConfig->skip([
// we must adapt service definition
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
// waiting for fixing this bug: https://github.com/rectorphp/rector-doctrine/issues/342
\Rector\Doctrine\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector::class,
]);
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [

View File

@@ -68,7 +68,7 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory,
private readonly ChillSecurity $security
private readonly ChillSecurity $security,
) {}
/**

View File

@@ -22,7 +22,6 @@ class AdminActivityPresenceController extends CRUDController
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -22,7 +22,6 @@ class AdminActivityTypeCategoryController extends CRUDController
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -22,7 +22,6 @@ class AdminActivityTypeController extends CRUDController
*
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
#[\Override]
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/* @var \Doctrine\ORM\QueryBuilder $query */

View File

@@ -32,13 +32,11 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
$this->faker = FakerFactory::create('fr_FR');
}
#[\Override]
public function getOrder()
{
return 16400;
}
#[\Override]
public function load(ObjectManager $manager)
{
$persons = $this->em

View File

@@ -38,7 +38,6 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt
],
];
#[\Override]
public function getDependencies()
{
return [

View File

@@ -23,13 +23,11 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf
{
public static $references = [];
#[\Override]
public function getOrder()
{
return 16300;
}
#[\Override]
public function load(ObjectManager $manager)
{
$reasons = [

View File

@@ -21,13 +21,11 @@ use Doctrine\Persistence\ObjectManager;
*/
class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface
{
#[\Override]
public function getOrder()
{
return 16200;
}
#[\Override]
public function load(ObjectManager $manager)
{
$categs = [

View File

@@ -23,13 +23,11 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface
{
public static $references = [];
#[\Override]
public function getOrder()
{
return 16100;
}
#[\Override]
public function load(ObjectManager $manager)
{
$types = [

View File

@@ -23,13 +23,11 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac
{
public static $references = [];
#[\Override]
public function getOrder()
{
return 16050;
}
#[\Override]
public function load(ObjectManager $manager)
{
$categories = [

View File

@@ -26,13 +26,11 @@ use Doctrine\Persistence\ObjectManager;
*/
class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface
{
#[\Override]
public function getOrder()
{
return 16000;
}
#[\Override]
public function load(ObjectManager $manager)
{
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {

View File

@@ -25,7 +25,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class ChillActivityExtension extends Extension implements PrependExtensionInterface
{
#[\Override]
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
@@ -45,7 +44,6 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$loader->load('services/doctrine.entitylistener.yaml');
}
#[\Override]
public function prepend(ContainerBuilder $container)
{
$this->prependRoutes($container);

View File

@@ -22,7 +22,6 @@ use function is_int;
*/
class Configuration implements ConfigurationInterface
{
#[\Override]
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('chill_activity');

View File

@@ -53,9 +53,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
use TrackUpdateTrait;
final public const string SENTRECEIVED_RECEIVED = 'received';
final public const SENTRECEIVED_RECEIVED = 'received';
final public const string SENTRECEIVED_SENT = 'sent';
final public const SENTRECEIVED_SENT = 'sent';
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
@@ -80,7 +80,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private \DateTime $date;
/**
* @var Collection<StoredObject>
* @var Collection<int, StoredObject>
*/
#[Assert\Valid(traverse: true)]
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])]
@@ -107,7 +107,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private ?Person $person = null;
/**
* @var Collection<Person>
* @var Collection<int, \Chill\PersonBundle\Entity\Person>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: Person::class)]
@@ -117,7 +117,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private PrivateCommentEmbeddable $privateComment;
/**
* @var Collection<ActivityReason>
* @var Collection<int, ActivityReason>
*/
#[Groups(['docgen:read'])]
#[ORM\ManyToMany(targetEntity: ActivityReason::class)]
@@ -132,7 +132,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private string $sentReceived = '';
/**
* @var Collection<SocialAction>
* @var Collection<int, \Chill\PersonBundle\Entity\SocialWork\SocialAction>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialAction::class)]
@@ -140,7 +140,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private Collection $socialActions;
/**
* @var Collection<SocialIssue>
* @var Collection<int, SocialIssue>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialIssue::class)]
@@ -148,7 +148,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private Collection $socialIssues;
/**
* @var Collection<ThirdParty>
* @var Collection<int, ThirdParty>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
@@ -162,7 +162,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
private ?User $user = null;
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: User::class)]
@@ -262,7 +262,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this;
}
#[\Override]
public function getAccompanyingPeriod(): ?AccompanyingPeriod
{
return $this->accompanyingPeriod;
@@ -282,7 +281,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* get the center
* center is extracted from person.
*/
#[\Override]
public function getCenters(): iterable
{
if ($this->person instanceof Person) {
@@ -401,7 +399,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->scope;
}
#[\Override]
public function getScopes(): iterable
{
if (null !== $this->getAccompanyingPeriod()) {
@@ -425,7 +422,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->socialActions;
}
#[\Override]
public function getSocialIssues(): Collection
{
return $this->socialIssues;
@@ -496,7 +492,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this;
}
#[\Override]
public function removeSocialIssue(SocialIssue $socialIssue): self
{
$this->socialIssues->removeElement($socialIssue);

View File

@@ -40,9 +40,9 @@ class ActivityReasonCategory implements \Stringable
/**
* Array of ActivityReason.
*
* @var Collection<ActivityReason>
* @var Collection<int, ActivityReason>
*/
#[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')]
#[ORM\OneToMany(mappedBy: 'category', targetEntity: ActivityReason::class)]
private Collection $reasons;
/**
@@ -53,7 +53,6 @@ class ActivityReasonCategory implements \Stringable
$this->reasons = new ArrayCollection();
}
#[\Override]
public function __toString(): string
{
return 'ActivityReasonCategory('.$this->getName('x').')';

View File

@@ -25,11 +25,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[ORM\Table(name: 'activitytype')]
class ActivityType
{
final public const int FIELD_INVISIBLE = 0;
final public const FIELD_INVISIBLE = 0;
final public const int FIELD_OPTIONAL = 1;
final public const FIELD_OPTIONAL = 1;
final public const int FIELD_REQUIRED = 2;
final public const FIELD_REQUIRED = 2;
/**
* @deprecated not in use

View File

@@ -19,13 +19,11 @@ use Symfony\Component\Form\FormBuilderInterface;
class ByActivityNumberAggregator implements AggregatorInterface
{
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void
{
$qb
@@ -33,25 +31,21 @@ class ByActivityNumberAggregator implements AggregatorInterface
->addGroupBy('activity_by_number_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACP_TYPE;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder): void
{
// No form needed
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return static function ($value) {
@@ -67,13 +61,11 @@ class ByActivityNumberAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['activity_by_number_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group acp by activity number';

View File

@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ByActivityTypeAggregator implements AggregatorInterface
{
private const string PREFIX = 'acp_by_activity_type_agg';
private const PREFIX = 'acp_by_activity_type_agg';
public function __construct(
private RollingDateConverterInterface $rollingDateConverter,
@@ -33,7 +33,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
private TranslatableStringHelperInterface $translatableStringHelper,
) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -47,7 +46,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -56,7 +54,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
];
}
#[\Override]
public function getLabels($key, array $values, mixed $data)
{
return function (int|string|null $value): string {
@@ -72,25 +69,21 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data)
{
return [self::PREFIX.'_actype_id'];
}
#[\Override]
public function getTitle()
{
return 'export.aggregator.acp.by_activity_type.title';
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -122,7 +115,6 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
->addGroupBy("{$p}_actype_id");
}
#[\Override]
public function applyOn()
{
return Declarations::ACP_TYPE;

View File

@@ -22,13 +22,11 @@ class BySocialActionAggregator implements AggregatorInterface
{
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
@@ -39,25 +37,21 @@ class BySocialActionAggregator implements AggregatorInterface
$qb->addGroupBy('socialaction_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY_ACP;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value) {
@@ -75,13 +69,11 @@ class BySocialActionAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['socialaction_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by linked socialaction';

View File

@@ -22,13 +22,11 @@ class BySocialIssueAggregator implements AggregatorInterface
{
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
@@ -39,25 +37,21 @@ class BySocialIssueAggregator implements AggregatorInterface
$qb->addGroupBy('socialissue_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY_ACP;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -75,13 +69,11 @@ class BySocialIssueAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['socialissue_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by linked socialissue';

View File

@@ -18,15 +18,13 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ActivityLocationAggregator implements AggregatorInterface
{
public const string KEY = 'activity_location_aggregator';
public const KEY = 'activity_location_aggregator';
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
@@ -36,25 +34,21 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form required for this aggregator
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data): \Closure
{
return function ($value): string {
@@ -70,13 +64,11 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::KEY];
}
#[\Override]
public function getTitle()
{
return 'export.aggregator.activity.by_location.Title';

View File

@@ -22,16 +22,13 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
{
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, mixed $data)
{
return function (int|string|null $value): string {
@@ -47,32 +44,27 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data)
{
return ['activity_presence_aggregator_attendee'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_activity_presence.Group activity by presence';
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void
{
$qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee');
$qb->addGroupBy('activity_presence_aggregator_attendee');
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;

View File

@@ -28,16 +28,14 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
public function __construct(
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
protected ActivityReasonRepository $activityReasonRepository,
protected TranslatableStringHelper $translatableStringHelper
protected TranslatableStringHelper $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
@@ -69,13 +67,11 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
$qb->addGroupBy($alias);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add(
@@ -93,7 +89,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
);
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -101,7 +96,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value) use ($data) {
@@ -131,7 +125,6 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
};
}
#[\Override]
public function getQueryKeys($data)
{
// add select element
@@ -146,13 +139,11 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
throw new \RuntimeException('The data provided are not recognised.');
}
#[\Override]
public function getTitle()
{
return 'Aggregate by activity reason';
}
#[\Override]
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['level']) {

View File

@@ -20,17 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityTypeAggregator implements AggregatorInterface
{
final public const string KEY = 'activity_type_aggregator';
final public const KEY = 'activity_type_aggregator';
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('acttype', $qb->getAllAliases(), true)) {
@@ -41,25 +39,21 @@ class ActivityTypeAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form required for this aggregator
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data): \Closure
{
return function (int|string|null $value): string {
@@ -75,13 +69,11 @@ class ActivityTypeAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::KEY];
}
#[\Override]
public function getTitle()
{
return 'Aggregate by activity type';

View File

@@ -20,17 +20,15 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUserAggregator implements AggregatorInterface
{
final public const string KEY = 'activity_user_id';
final public const KEY = 'activity_user_id';
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
@@ -40,25 +38,21 @@ class ActivityUserAggregator implements AggregatorInterface
$qb->addGroupBy(self::KEY);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// nothing to add
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, $values, $data): \Closure
{
return function ($value) {
@@ -76,13 +70,11 @@ class ActivityUserAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data)
{
return [self::KEY];
}
#[\Override]
public function getTitle(): string
{
return 'Aggregate by activity user';

View File

@@ -22,13 +22,11 @@ class ActivityUsersAggregator implements AggregatorInterface
{
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actusers', $qb->getAllAliases(), true)) {
@@ -40,25 +38,21 @@ class ActivityUsersAggregator implements AggregatorInterface
->addGroupBy('activity_users_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// nothing to add on the form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value) {
@@ -76,13 +70,11 @@ class ActivityUsersAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data)
{
return ['activity_users_aggregator'];
}
#[\Override]
public function getTitle()
{
return 'Aggregate by activity users';

View File

@@ -22,20 +22,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersJobAggregator implements AggregatorInterface
{
private const string PREFIX = 'act_agg_user_job';
private const PREFIX = 'act_agg_user_job';
public function __construct(
private readonly UserJobRepositoryInterface $userJobRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper
private readonly TranslatableStringHelperInterface $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,22 +60,18 @@ class ActivityUsersJobAggregator implements AggregatorInterface
->addGroupBy("{$p}_select");
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -97,13 +91,11 @@ class ActivityUsersJobAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::PREFIX.'_select'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_user_job.Aggregate by users job';

View File

@@ -22,20 +22,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class ActivityUsersScopeAggregator implements AggregatorInterface
{
private const string PREFIX = 'act_agg_user_scope';
private const PREFIX = 'act_agg_user_scope';
public function __construct(
private readonly ScopeRepositoryInterface $scopeRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper
private readonly TranslatableStringHelperInterface $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,22 +60,18 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
->addGroupBy("{$p}_select");
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -97,13 +91,11 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::PREFIX.'_select'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_user_scope.Aggregate by users scope';

View File

@@ -22,38 +22,32 @@ class ByCreatorAggregator implements AggregatorInterface
{
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
$qb->addGroupBy('creator_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -71,13 +65,11 @@ class ByCreatorAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['creator_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by creator';

View File

@@ -22,13 +22,11 @@ class ByThirdpartyAggregator implements AggregatorInterface
{
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
@@ -39,25 +37,21 @@ class ByThirdpartyAggregator implements AggregatorInterface
$qb->addGroupBy('thirdparty_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -75,13 +69,11 @@ class ByThirdpartyAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['thirdparty_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by linked thirdparties';

View File

@@ -22,20 +22,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorJobAggregator implements AggregatorInterface
{
private const string PREFIX = 'acp_agg_creator_job';
private const PREFIX = 'acp_agg_creator_job';
public function __construct(
private readonly UserJobRepositoryInterface $userJobRepository,
private readonly TranslatableStringHelper $translatableStringHelper
private readonly TranslatableStringHelper $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,22 +60,18 @@ class CreatorJobAggregator implements AggregatorInterface
->addGroupBy("{$p}_select");
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -95,13 +89,11 @@ class CreatorJobAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::PREFIX.'_select'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_creator_job.Group activity by creator job';

View File

@@ -22,20 +22,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorScopeAggregator implements AggregatorInterface
{
private const string PREFIX = 'acp_agg_creator_scope';
private const PREFIX = 'acp_agg_creator_scope';
public function __construct(
private readonly ScopeRepository $scopeRepository,
private readonly TranslatableStringHelper $translatableStringHelper
private readonly TranslatableStringHelper $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,22 +60,18 @@ class CreatorScopeAggregator implements AggregatorInterface
->addGroupBy("{$p}_select");
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -97,13 +91,11 @@ class CreatorScopeAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return [self::PREFIX.'_select'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope';

View File

@@ -19,21 +19,19 @@ use Symfony\Component\Form\FormBuilderInterface;
class DateAggregator implements AggregatorInterface
{
private const array CHOICES = [
private const CHOICES = [
'by month' => 'month',
'by week' => 'week',
'by year' => 'year',
];
private const string DEFAULT_CHOICE = 'year';
private const DEFAULT_CHOICE = 'year';
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$order = null;
@@ -64,13 +62,11 @@ class DateAggregator implements AggregatorInterface
$qb->addOrderBy('date_aggregator', $order);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('frequency', ChoiceType::class, [
@@ -80,13 +76,11 @@ class DateAggregator implements AggregatorInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return ['frequency' => self::DEFAULT_CHOICE];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return static function ($value) use ($data): string {
@@ -104,13 +98,11 @@ class DateAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['date_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by date';

View File

@@ -22,13 +22,11 @@ class LocationTypeAggregator implements AggregatorInterface
{
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
@@ -39,25 +37,21 @@ class LocationTypeAggregator implements AggregatorInterface
$qb->addGroupBy('locationtype_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return function ($value): string {
@@ -79,13 +73,11 @@ class LocationTypeAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['locationtype_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'Group activity by locationtype';

View File

@@ -21,43 +21,36 @@ final readonly class PersonAggregator implements AggregatorInterface
{
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// nothing to add here
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, mixed $data)
{
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
}
#[\Override]
public function getQueryKeys($data)
{
return ['activity_by_person_agg'];
}
#[\Override]
public function getTitle()
{
return 'export.aggregator.person.by_person.title';
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
@@ -65,7 +58,6 @@ final readonly class PersonAggregator implements AggregatorInterface
->addGroupBy('activity_by_person_agg');
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY_PERSON;

View File

@@ -23,23 +23,20 @@ use Symfony\Component\Form\FormBuilderInterface;
*/
final readonly class PersonsAggregator implements AggregatorInterface
{
private const string PREFIX = 'act_persons_agg';
private const PREFIX = 'act_persons_agg';
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// nothing to add here
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, mixed $data)
{
if ($key !== self::PREFIX.'_pid') {
@@ -49,25 +46,21 @@ final readonly class PersonsAggregator implements AggregatorInterface
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons');
}
#[\Override]
public function getQueryKeys($data)
{
return [self::PREFIX.'_pid'];
}
#[\Override]
public function getTitle()
{
return 'export.aggregator.activity.by_persons.Group activity by persons';
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -78,7 +71,6 @@ final readonly class PersonsAggregator implements AggregatorInterface
->addGroupBy("{$p}_pid");
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;

View File

@@ -21,38 +21,32 @@ class SentReceivedAggregator implements AggregatorInterface
{
public function __construct(private readonly TranslatorInterface $translator) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data): void
{
$qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator')
->addGroupBy('activity_sentreceived_aggregator');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder): void
{
// No form needed
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getLabels($key, array $values, $data): callable
{
return function (?string $value): string {
@@ -77,13 +71,11 @@ class SentReceivedAggregator implements AggregatorInterface
};
}
#[\Override]
public function getQueryKeys($data): array
{
return ['activity_sentreceived_aggregator'];
}
#[\Override]
public function getTitle(): string
{
return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived';

View File

@@ -36,34 +36,28 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'Average activities linked to an accompanying period duration by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_avg_activity_duration' !== $key) {
@@ -73,31 +67,26 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_avg_activity_duration'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'Average activity linked to an accompanying period duration';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -127,13 +116,11 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -41,37 +41,31 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// TODO: Implement buildForm() method.
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'Average activities linked to an accompanying period visit duration by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_avg_activity_visit_duration' !== $key) {
@@ -81,31 +75,26 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_avg_activity_visit_duration'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'Average activity linked to an accompanying period visit duration';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -135,13 +124,11 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -41,34 +41,28 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'Count activities linked to an accompanying period by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_count_activity' !== $key) {
@@ -78,31 +72,26 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_count_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'Count activities linked to an accompanying period';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -131,13 +120,11 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -42,34 +42,28 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'export.export.count_household_on_activity.description';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_count_activity' !== $key) {
@@ -79,31 +73,26 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_count_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'export.export.count_household_on_activity.title';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -140,13 +129,11 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -41,34 +41,28 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'export.export.count_person_on_activity.description';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_count_activity' !== $key) {
@@ -78,31 +72,26 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_count_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'export.export.count_person_on_activity.title';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -132,13 +121,11 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -33,37 +33,31 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$this->helper->buildForm($builder);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return $this->helper->getAllowedFormattersTypes();
}
#[\Override]
public function getDescription()
{
return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
return match ($key) {
@@ -79,7 +73,6 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
};
}
#[\Override]
public function getQueryKeys($data)
{
return
@@ -92,25 +85,21 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
);
}
#[\Override]
public function getResult($query, $data)
{
return $this->helper->getResult($query, $data);
}
#[\Override]
public function getTitle()
{
return ListActivityHelper::MSG_KEY.'List activity linked to a course';
}
#[\Override]
public function getType()
{
return $this->helper->getType();
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -146,13 +135,11 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::LISTS;
}
#[\Override]
public function supportsModifiers()
{
return array_merge(

View File

@@ -40,37 +40,31 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// TODO: Implement buildForm() method.
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'Sum activities linked to an accompanying period duration by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_sum_activity_duration' !== $key) {
@@ -80,31 +74,26 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_sum_activity_duration'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'Sum activity linked to an accompanying period duration';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -134,13 +123,11 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -40,37 +40,31 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// TODO: Implement buildForm() method.
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes(): array
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription(): string
{
return 'Sum activities linked to an accompanying period visit duration by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to an accompanying period';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_sum_activity_visit_duration' !== $key) {
@@ -80,31 +74,26 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
}
#[\Override]
public function getQueryKeys($data): array
{
return ['export_sum_activity_visit_duration'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle(): string
{
return 'Sum activity linked to an accompanying period visit duration';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -134,13 +123,11 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers(): array
{
return [

View File

@@ -33,34 +33,28 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription()
{
return 'Count activities linked to a person by various parameters.';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to a person';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_count_activity' !== $key) {
@@ -70,31 +64,26 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value;
}
#[\Override]
public function getQueryKeys($data)
{
return ['export_count_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle()
{
return 'Count activities linked to a person';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -124,13 +113,11 @@ class CountActivity implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers()
{
return [

View File

@@ -34,34 +34,28 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription()
{
return 'export.export.count_household_on_activity_person.description';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to a person';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_count_activity' !== $key) {
@@ -71,31 +65,26 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value;
}
#[\Override]
public function getQueryKeys($data)
{
return ['export_count_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle()
{
return 'export.export.count_household_on_activity_person.title';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -132,13 +121,11 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers()
{
return [

View File

@@ -57,7 +57,6 @@ class ListActivity implements ListInterface, GroupedExportInterface
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('fields', ChoiceType::class, [
@@ -77,31 +76,26 @@ class ListActivity implements ListInterface, GroupedExportInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_LIST];
}
#[\Override]
public function getDescription()
{
return 'List activities linked to a person description';
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to a person';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
switch ($key) {
@@ -171,31 +165,26 @@ class ListActivity implements ListInterface, GroupedExportInterface
}
}
#[\Override]
public function getQueryKeys($data)
{
return $data['fields'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle()
{
return 'List activity linked to a person';
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
@@ -290,13 +279,11 @@ class ListActivity implements ListInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::LISTS;
}
#[\Override]
public function supportsModifiers()
{
return [

View File

@@ -30,7 +30,7 @@ use Symfony\Component\Form\FormBuilderInterface;
*/
class StatActivityDuration implements ExportInterface, GroupedExportInterface
{
final public const string SUM = 'sum';
final public const SUM = 'sum';
private readonly bool $filterStatsByCenters;
/**
@@ -42,27 +42,23 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
/**
* The action for this report.
*/
protected string $action = 'sum'
protected string $action = 'sum',
) {
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
#[\Override]
public function buildForm(FormBuilderInterface $builder) {}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
}
#[\Override]
public function getDescription()
{
if (self::SUM === $this->action) {
@@ -72,13 +68,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
throw new \LogicException('this action is not supported: '.$this->action);
}
#[\Override]
public function getGroup(): string
{
return 'Exports of activities linked to a person';
}
#[\Override]
public function getLabels($key, array $values, $data)
{
if ('export_stat_activity' !== $key) {
@@ -90,19 +84,16 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
return static fn (string $value) => '_header' === $value ? $header : $value;
}
#[\Override]
public function getQueryKeys($data)
{
return ['export_stat_activity'];
}
#[\Override]
public function getResult($query, $data)
{
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
}
#[\Override]
public function getTitle()
{
if (self::SUM === $this->action) {
@@ -112,13 +103,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
throw new \LogicException('This action is not supported: '.$this->action);
}
#[\Override]
public function getType(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(
@@ -156,13 +145,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
return $qb;
}
#[\Override]
public function requiredRole(): string
{
return ActivityStatsVoter::STATS;
}
#[\Override]
public function supportsModifiers()
{
return [

View File

@@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ListActivityHelper
{
final public const string MSG_KEY = 'export.list.activity.';
final public const MSG_KEY = 'export.list.activity.';
public function __construct(
private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository,
@@ -39,7 +39,7 @@ class ListActivityHelper
private readonly TranslatorInterface $translator,
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper,
private readonly UserHelper $userHelper
private readonly UserHelper $userHelper,
) {}
public function addSelect(QueryBuilder $qb): void

View File

@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
final readonly class ActivityTypeFilter implements FilterInterface
{
private const string BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
public function __construct(
private ActivityTypeRepositoryInterface $activityTypeRepository,
@@ -33,13 +33,11 @@ final readonly class ActivityTypeFilter implements FilterInterface
private RollingDateConverterInterface $rollingDateConverter,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$exists = self::BASE_EXISTS;
@@ -64,13 +62,11 @@ final readonly class ActivityTypeFilter implements FilterInterface
}
}
#[\Override]
public function applyOn()
{
return Declarations::ACP_TYPE;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_activitytypes', EntityType::class, [
@@ -96,7 +92,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -106,7 +101,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$types = [];
@@ -124,7 +118,6 @@ final readonly class ActivityTypeFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter accompanying course by activity type';

View File

@@ -23,13 +23,11 @@ class BySocialActionFilter implements FilterInterface
{
public function __construct(private readonly SocialActionRender $actionRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
@@ -45,13 +43,11 @@ class BySocialActionFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY_ACP;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_socialactions', PickSocialActionType::class, [
@@ -59,13 +55,11 @@ class BySocialActionFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$actions = [];
@@ -81,7 +75,6 @@ class BySocialActionFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by linked socialaction';

View File

@@ -23,13 +23,11 @@ class BySocialIssueFilter implements FilterInterface
{
public function __construct(private readonly SocialIssueRender $issueRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
@@ -45,13 +43,11 @@ class BySocialIssueFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY_ACP;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
@@ -59,13 +55,11 @@ class BySocialIssueFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$issues = [];
@@ -81,7 +75,6 @@ class BySocialIssueFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by linked socialissue';

View File

@@ -22,13 +22,11 @@ use Symfony\Component\Form\FormBuilderInterface;
*/
class HasNoActivityFilter implements FilterInterface
{
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
@@ -40,31 +38,26 @@ class HasNoActivityFilter implements FilterInterface
');
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACP_TYPE;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
// no form needed
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
return ['Filtered acp which has no activities', []];
}
#[\Override]
public function getTitle(): string
{
return 'Filter acp which has no activity';

View File

@@ -25,13 +25,11 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
private RollingDateConverterInterface $rollingDateConverter,
) {}
#[\Override]
public function getTitle()
{
return 'export.filter.activity.course_having_activity_between_date.Title';
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -43,7 +41,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -52,7 +49,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
return [
@@ -64,13 +60,11 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
];
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$alias = 'act_period_having_act_betw_date_alias';
@@ -88,7 +82,6 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
}
#[\Override]
public function applyOn()
{
return \Chill\PersonBundle\Export\Declarations::ACP_TYPE;

View File

@@ -25,13 +25,11 @@ class ActivityDateFilter implements FilterInterface
{
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -58,13 +56,11 @@ class ActivityDateFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -76,13 +72,11 @@ class ActivityDateFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
return [
@@ -94,7 +88,6 @@ class ActivityDateFilter implements FilterInterface
];
}
#[\Override]
public function getTitle()
{
return 'Filtered by date activity';

View File

@@ -25,16 +25,14 @@ final readonly class ActivityPresenceFilter implements FilterInterface
{
public function __construct(
private TranslatableStringHelperInterface $translatableStringHelper,
private TranslatorInterface $translator
private TranslatorInterface $translator,
) {}
#[\Override]
public function getTitle()
{
return 'export.filter.activity.by_presence.Filter activity by activity presence';
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('presences', EntityType::class, [
@@ -47,13 +45,11 @@ final readonly class ActivityPresenceFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
$presences = array_map(
@@ -67,13 +63,11 @@ final readonly class ActivityPresenceFilter implements FilterInterface
];
}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
@@ -81,7 +75,6 @@ final readonly class ActivityPresenceFilter implements FilterInterface
->setParameter('activity_presence_filter_presences', $data['presences']);
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;

View File

@@ -26,16 +26,14 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
{
public function __construct(
protected TranslatableStringHelperInterface $translatableStringHelper,
protected ActivityTypeRepositoryInterface $activityTypeRepository
protected ActivityTypeRepositoryInterface $activityTypeRepository,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
@@ -44,13 +42,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
$qb->setParameter('selected_activity_types', $data['types']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('types', EntityType::class, [
@@ -74,13 +70,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
@@ -94,13 +88,11 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
]];
}
#[\Override]
public function getTitle()
{
return 'Filter by activity type';
}
#[\Override]
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['types'] || 0 === \count($data['types'])) {

View File

@@ -22,13 +22,11 @@ class ActivityUsersFilter implements FilterInterface
{
public function __construct(private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$orX = $qb->expr()->orX();
@@ -41,13 +39,11 @@ class ActivityUsersFilter implements FilterInterface
$qb->andWhere($orX);
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_users', PickUserDynamicType::class, [
@@ -56,13 +52,11 @@ class ActivityUsersFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
$users = [];
@@ -76,7 +70,6 @@ class ActivityUsersFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by users';

View File

@@ -22,13 +22,11 @@ class ByCreatorFilter implements FilterInterface
{
public function __construct(private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
@@ -38,13 +36,11 @@ class ByCreatorFilter implements FilterInterface
->setParameter('users', $data['accepted_users']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_users', PickUserDynamicType::class, [
@@ -52,13 +48,11 @@ class ByCreatorFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$users = [];
@@ -72,7 +66,6 @@ class ByCreatorFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by creator';

View File

@@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final readonly class CreatorJobFilter implements FilterInterface
{
private const string PREFIX = 'acp_act_filter_creator_job';
private const PREFIX = 'acp_act_filter_creator_job';
public function __construct(
private TranslatableStringHelper $translatableStringHelper,
@@ -34,13 +34,11 @@ final readonly class CreatorJobFilter implements FilterInterface
private UserJobRepositoryInterface $userJobRepository,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -72,13 +70,11 @@ final readonly class CreatorJobFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -94,7 +90,6 @@ final readonly class CreatorJobFilter implements FilterInterface
]);
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$jobs = array_map(
@@ -107,7 +102,6 @@ final readonly class CreatorJobFilter implements FilterInterface
]];
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -115,7 +109,6 @@ final readonly class CreatorJobFilter implements FilterInterface
];
}
#[\Override]
public function getTitle(): string
{
return 'export.filter.activity.by_creator_job.Filter activity by user job';

View File

@@ -24,20 +24,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class CreatorScopeFilter implements FilterInterface
{
private const string PREFIX = 'acp_act_filter_creator_scope';
private const PREFIX = 'acp_act_filter_creator_scope';
public function __construct(
private readonly TranslatableStringHelper $translatableStringHelper,
private readonly ScopeRepositoryInterface $scopeRepository,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -69,13 +67,11 @@ class CreatorScopeFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -90,7 +86,6 @@ class CreatorScopeFilter implements FilterInterface
]);
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$scopes = [];
@@ -106,7 +101,6 @@ class CreatorScopeFilter implements FilterInterface
]];
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -114,7 +108,6 @@ class CreatorScopeFilter implements FilterInterface
];
}
#[\Override]
public function getTitle(): string
{
return 'export.filter.activity.by_creator_scope.Filter activity by user scope';

View File

@@ -21,22 +21,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyFilter implements FilterInterface
{
private const array CHOICES = [
private const CHOICES = [
'activity is emergency' => 'true',
'activity is not emergency' => 'false',
];
private const string DEFAULT_CHOICE = 'false';
private const DEFAULT_CHOICE = 'false';
public function __construct(private readonly TranslatorInterface $translator) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -53,13 +51,11 @@ class EmergencyFilter implements FilterInterface
$qb->setParameter('emergency', $data['accepted_emergency']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_emergency', ChoiceType::class, [
@@ -70,13 +66,11 @@ class EmergencyFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return ['accepted_emergency' => self::DEFAULT_CHOICE];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
return [
@@ -88,7 +82,6 @@ class EmergencyFilter implements FilterInterface
];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by emergency';

View File

@@ -19,13 +19,11 @@ use Symfony\Component\Form\FormBuilderInterface;
class LocationFilter implements FilterInterface
{
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$qb->andWhere(
@@ -35,13 +33,11 @@ class LocationFilter implements FilterInterface
$qb->setParameter('location', $data['accepted_location']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_location', PickUserLocationType::class, [
@@ -50,13 +46,11 @@ class LocationFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$locations = [];
@@ -70,7 +64,6 @@ class LocationFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by location';

View File

@@ -23,13 +23,11 @@ class LocationTypeFilter implements FilterInterface
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
@@ -49,13 +47,11 @@ class LocationTypeFilter implements FilterInterface
$qb->setParameter('locationtype', $data['accepted_locationtype']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
@@ -64,13 +60,11 @@ class LocationTypeFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$types = [];
@@ -86,7 +80,6 @@ class LocationTypeFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by locationtype';

View File

@@ -28,13 +28,11 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
{
public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -55,13 +53,11 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
$qb->setParameter('selected_activity_reasons', $data['reasons']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY_PERSON;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('reasons', EntityType::class, [
@@ -74,13 +70,11 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
@@ -97,13 +91,11 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
];
}
#[\Override]
public function getTitle()
{
return 'Filter by reason';
}
#[\Override]
public function validateForm($data, ExecutionContextInterface $context)
{
if (null === $data['reasons'] || 0 === \count($data['reasons'])) {

View File

@@ -34,13 +34,11 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
private RollingDateConverterInterface $rollingDateConverter,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
// create a subquery for activity
@@ -85,13 +83,11 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::PERSON_TYPE;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_from_rolling', PickRollingDateType::class, [
@@ -116,7 +112,6 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
}
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -126,7 +121,6 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
return [
@@ -147,13 +141,11 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
];
}
#[\Override]
public function getTitle()
{
return 'export.filter.activity.person_between_dates.title';
}
#[\Override]
public function validateForm($data, ExecutionContextInterface $context)
{
if ($this->rollingDateConverter->convert($data['date_from_rolling'])

View File

@@ -24,17 +24,15 @@ use Symfony\Component\Form\FormBuilderInterface;
*/
final readonly class PersonsFilter implements FilterInterface
{
private const string PREFIX = 'act_persons_filter';
private const PREFIX = 'act_persons_filter';
public function __construct(private PersonRenderInterface $personRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -49,13 +47,11 @@ final readonly class PersonsFilter implements FilterInterface
$qb->andWhere($orX);
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_persons', PickPersonDynamicType::class, [
@@ -64,7 +60,6 @@ final readonly class PersonsFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -72,7 +67,6 @@ final readonly class PersonsFilter implements FilterInterface
];
}
#[\Override]
public function describeAction($data, $format = 'string')
{
$users = [];
@@ -86,7 +80,6 @@ final readonly class PersonsFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'export.filter.activity.by_persons.Filter activity by persons';

View File

@@ -22,22 +22,20 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class SentReceivedFilter implements FilterInterface
{
private const array CHOICES = [
private const CHOICES = [
'export.filter.activity.by_sent_received.is sent' => Activity::SENTRECEIVED_SENT,
'export.filter.activity.by_sent_received.is received' => Activity::SENTRECEIVED_RECEIVED,
];
private const string DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
public function __construct(private readonly TranslatorInterface $translator) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -54,13 +52,11 @@ class SentReceivedFilter implements FilterInterface
$qb->setParameter('sentreceived', $data['accepted_sentreceived']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_sentreceived', ChoiceType::class, [
@@ -72,13 +68,11 @@ class SentReceivedFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return ['accepted_sentreceived' => self::DEFAULT_CHOICE];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$sentreceived = array_flip(self::CHOICES)[$data['accepted_sentreceived']];
@@ -88,7 +82,6 @@ class SentReceivedFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by sentreceived';

View File

@@ -23,13 +23,11 @@ class UserFilter implements FilterInterface
{
public function __construct(private readonly UserRender $userRender) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -46,13 +44,11 @@ class UserFilter implements FilterInterface
$qb->setParameter('users', $data['accepted_users']);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('accepted_users', PickUserDynamicType::class, [
@@ -61,13 +57,11 @@ class UserFilter implements FilterInterface
]);
}
#[\Override]
public function getFormDefaultData(): array
{
return [];
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
$users = [];
@@ -81,7 +75,6 @@ class UserFilter implements FilterInterface
]];
}
#[\Override]
public function getTitle(): string
{
return 'Filter activity by user';

View File

@@ -25,20 +25,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class UsersJobFilter implements FilterInterface
{
private const string PREFIX = 'act_filter_user_job';
private const PREFIX = 'act_filter_user_job';
public function __construct(
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly UserJobRepositoryInterface $userJobRepository
private readonly UserJobRepositoryInterface $userJobRepository,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,13 +60,11 @@ class UsersJobFilter implements FilterInterface
);
}
#[\Override]
public function applyOn()
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -81,7 +77,6 @@ class UsersJobFilter implements FilterInterface
]);
}
#[\Override]
public function describeAction($data, $format = 'string')
{
return ['export.filter.activity.by_users_job.Filtered activity by users job: only %jobs%', [
@@ -95,7 +90,6 @@ class UsersJobFilter implements FilterInterface
]];
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -103,7 +97,6 @@ class UsersJobFilter implements FilterInterface
];
}
#[\Override]
public function getTitle()
{
return 'export.filter.activity.by_users_job.Filter by users job';

View File

@@ -25,20 +25,18 @@ use Symfony\Component\Form\FormBuilderInterface;
class UsersScopeFilter implements FilterInterface
{
private const string PREFIX = 'act_filter_user_scope';
private const PREFIX = 'act_filter_user_scope';
public function __construct(
private readonly ScopeRepositoryInterface $scopeRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper
private readonly TranslatableStringHelperInterface $translatableStringHelper,
) {}
#[\Override]
public function addRole(): ?string
{
return null;
}
#[\Override]
public function alterQuery(QueryBuilder $qb, $data)
{
$p = self::PREFIX;
@@ -62,13 +60,11 @@ class UsersScopeFilter implements FilterInterface
);
}
#[\Override]
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
#[\Override]
public function buildForm(FormBuilderInterface $builder)
{
$builder
@@ -81,7 +77,6 @@ class UsersScopeFilter implements FilterInterface
]);
}
#[\Override]
public function describeAction($data, $format = 'string'): array
{
return ['export.filter.activity.by_users_scope.Filtered activity by users scope: only %scopes%', [
@@ -95,7 +90,6 @@ class UsersScopeFilter implements FilterInterface
]];
}
#[\Override]
public function getFormDefaultData(): array
{
return [
@@ -103,7 +97,6 @@ class UsersScopeFilter implements FilterInterface
];
}
#[\Override]
public function getTitle(): string
{
return 'export.filter.activity.by_users_scope.Filter by users scope';

View File

@@ -20,7 +20,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityPresenceType extends AbstractType
{
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
@@ -34,7 +33,6 @@ class ActivityPresenceType extends AbstractType
]);
}
#[\Override]
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([

View File

@@ -19,7 +19,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityReasonCategoryType extends AbstractType
{
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
@@ -30,7 +29,6 @@ class ActivityReasonCategoryType extends AbstractType
/**
* @param OptionsResolverInterface $resolver
*/
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
@@ -41,7 +39,6 @@ class ActivityReasonCategoryType extends AbstractType
/**
* @return string
*/
#[\Override]
public function getBlockPrefix()
{
return 'chill_activitybundle_activityreasoncategory';

View File

@@ -21,7 +21,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityReasonType extends AbstractType
{
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
@@ -30,7 +29,6 @@ class ActivityReasonType extends AbstractType
->add('category', TranslatableActivityReasonCategoryType::class);
}
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
@@ -41,7 +39,6 @@ class ActivityReasonType extends AbstractType
/**
* @return string
*/
#[\Override]
public function getBlockPrefix()
{
return 'chill_activitybundle_activityreason';

View File

@@ -59,7 +59,7 @@ class ActivityType extends AbstractType
protected TranslatableStringHelper $translatableStringHelper,
protected array $timeChoices,
protected SocialIssueRender $socialIssueRender,
protected SocialActionRender $socialActionRender
protected SocialActionRender $socialActionRender,
) {
if (!$tokenStorage->getToken()->getUser() instanceof User) {
throw new \RuntimeException('you should have a valid user');
@@ -68,7 +68,6 @@ class ActivityType extends AbstractType
$this->user = $tokenStorage->getToken()->getUser();
}
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// handle times choices
@@ -387,7 +386,6 @@ class ActivityType extends AbstractType
}
}
#[\Override]
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
@@ -402,7 +400,6 @@ class ActivityType extends AbstractType
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
}
#[\Override]
public function getBlockPrefix(): string
{
return 'chill_activitybundle_activity';

View File

@@ -21,7 +21,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityTypeCategoryType extends AbstractType
{
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
@@ -39,7 +38,6 @@ class ActivityTypeCategoryType extends AbstractType
]);
}
#[\Override]
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([

View File

@@ -27,7 +27,6 @@ class ActivityTypeType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
#[\Override]
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
@@ -68,7 +67,6 @@ class ActivityTypeType extends AbstractType
->add('commentVisible', ActivityFieldPresence::class);
}
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([

View File

@@ -18,7 +18,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityFieldPresence extends AbstractType
{
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
@@ -32,7 +31,6 @@ class ActivityFieldPresence extends AbstractType
);
}
#[\Override]
public function getParent()
{
return ChoiceType::class;

View File

@@ -27,10 +27,9 @@ class PickActivityReasonType extends AbstractType
public function __construct(
private readonly ActivityReasonRepository $activityReasonRepository,
private readonly ActivityReasonRender $reasonRender,
private readonly TranslatableStringHelperInterface $translatableStringHelper
private readonly TranslatableStringHelperInterface $translatableStringHelper,
) {}
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
@@ -50,13 +49,11 @@ class PickActivityReasonType extends AbstractType
);
}
#[\Override]
public function getBlockPrefix()
{
return 'translatable_activity_reason';
}
#[\Override]
public function getParent()
{
return EntityType::class;

View File

@@ -25,7 +25,6 @@ class TranslatableActivityReasonCategoryType extends AbstractType
{
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {}
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
@@ -37,7 +36,6 @@ class TranslatableActivityReasonCategoryType extends AbstractType
);
}
#[\Override]
public function getParent()
{
return EntityType::class;

View File

@@ -22,7 +22,6 @@ class TranslatableActivityType extends AbstractType
{
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {}
#[\Override]
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
@@ -35,13 +34,11 @@ class TranslatableActivityType extends AbstractType
);
}
#[\Override]
public function getBlockPrefix()
{
return 'translatable_activity_type';
}
#[\Override]
public function getParent()
{
return EntityType::class;

View File

@@ -25,7 +25,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
{
public function __construct(protected Security $security, protected TranslatorInterface $translator) {}
#[\Override]
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
$period = $parameters['accompanyingCourse'];
@@ -43,7 +42,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
}
}
#[\Override]
public static function getMenuIds(): array
{
return ['accompanyingCourse'];

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