phil / shifts-bundle
Volunteer shifts in Symfony: rosters and a swap board stored with Doctrine, volunteer and coordinator pages, a shift form, Twig components, Messenger.
Package info
github.com/parler-haut-interagir-librement/shifts-bundle
Type:symfony-bundle
pkg:composer/phil/shifts-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- doctrine/dbal: ^4.6
- phil/shifts: ^0.1@dev
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/routing: ^8.2
- symfony/security-core: ^8.2
- symfony/security-csrf: ^8.2
- symfony/uid: ^8.2
- twig/twig: ^3.31.1
Requires (Dev)
- doctrine/doctrine-bundle: ^3.4
- doctrine/orm: ^3.8
- phil/privacy-bundle: ^0.3@dev
- phpunit/phpunit: ^13.4
- symfony/browser-kit: ^8.2
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/event-dispatcher-contracts: ^3.8
- symfony/form: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/messenger: ^8.2
- symfony/options-resolver: ^8.2
- symfony/security-bundle: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-twig-component: ^3.8
Suggests
- doctrine/orm: To add the tables to the schema the ORM generates, for doctrine:migrations:diff
- phil/privacy-bundle: For the shifts and swaps of a volunteer in the export and the erasure of their data
- symfony/console: For phil:shifts:import
- symfony/form: For the coordinators' form of a shift, which the pages require
- symfony/messenger: To allocate the places among the interested in a worker
- symfony/security-bundle: For the pages, which know the person signed in and check the voters
- symfony/ux-twig-component: For the components <twig:PhilShifts:ShiftCard> and <twig:PhilShifts:MyShifts>
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-28 03:39:28 UTC
README
Volunteer shifts in Symfony: rosters and a swap board stored with Doctrine, volunteer and coordinator pages, a shift form, Twig components, Messenger.
phil/shifts-bundle brings phil/shifts to a Symfony application. It stores the shifts, their rosters and the
offers of the swap board through Doctrine DBAL, its tables added to the schema the ORM generates, so that
doctrine:migrations:diff writes their migration. A write is made over the revision read: two requests that change the
same roster at once never overwrite each other, and a place passed through the swap board is written with its offer in
one transaction.
The volunteers' pages list the shifts to come, critical ones lacking volunteers first, and let a volunteer sign up, join the reserve, say they are interested, withdraw, offer their place and take one offered. A volunteer never holds two fixed shifts that overlap, with the rest the configuration asks between them. The coordinators' pages plan and correct a shift through a Symfony form in the time zone of the site, assign and take off volunteers in every mode, allocate the places among the interested — through Messenger when the application has a bus — and approve or refuse the swaps that wait for them. Every page is a plain Twig form that works without JavaScript, with a CSRF token and the classes of the PHIL UX kit.
The Twig components <twig:PhilShifts:ShiftCard> and <twig:PhilShifts:MyShifts> show a shift with the buttons of
the person signed in, and that person's shifts with the hours they served, on any page of the application. Voters
decide who volunteers and who coordinates. The events of each change, which carry identifiers only, go to the
application's event dispatcher once stored. phil:shifts:import imports a plan in the format phil-shifts/1.
Two optional rules guard who joins a shift. A volunteer who is a minor on the day of a shift, by the birth date the application gives, joins once the contact of a parent or guardian is recorded with their consent. A coordinator records the unannounced absences; past a configured threshold, a volunteer no longer signs up by themselves until an organiser lifts the block.
A volunteer's shifts, offers, guardian's contact and absences are exported and erased through the contracts of phil/privacy-bundle. A Flex recipe registers the bundle, its configuration and its routes.
Status
| Part | State |
|---|---|
| The tables, the schema listener, the repositories with their revisions, the transaction of a swap | Implemented and tested |
| The volunteers' pages, the conflicts between fixed shifts, the swap board | Implemented and tested |
| The coordinators' pages, the form of a shift, the allocation through Messenger | Implemented and tested |
The components PhilShifts:ShiftCard and PhilShifts:MyShifts |
Implemented and tested |
The voters, the CSRF tokens, the events, the command phil:shifts:import |
Implemented and tested |
| The guardians of volunteers who are minors, the unannounced absences and their threshold | Implemented and tested |
| The export and the erasure of phil/privacy-bundle | Implemented and tested |
| The Flex recipe | Prepared in recipe/0.1 |
| Reminders before a shift, a personal iCalendar feed | Not written |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, the recipe, Security, the migration and a first shift. |
| Configuration | Every option, the roles, and what the bundle registers. |
| Pages and components | The volunteers' and coordinators' pages, the form, the components, accessibility. |
| Minors and absences | The consent of a guardian for a volunteer who is a minor, the unannounced absences and their threshold. |
| Storage and privacy | The tables, the revisions, the migration, the events, Messenger, and a volunteer's data. |
| Extension points | The services an application replaces, and what is stable. |
| Testing | The tests and the application they run in. |
| Reference | Every public type and route, with its role. |
Quick start
composer require phil/shifts-bundle php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate php bin/console phil:shifts:import plan.json
<twig:PhilShifts:ShiftCard id="desk-sat-am" /> <twig:PhilShifts:MyShifts limit="5" />
Requirements
PHP 8.5 or later with ext-mbstring, Symfony 8.2 with FrameworkBundle, Security, Forms and Twig, and Doctrine DBAL 4.
The ORM, Messenger, Console, the Twig components and phil/privacy-bundle are used when they are installed.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.