Download the PHP package prayno/moveon-course-catalogue-bundle without Composer
On this page you can find all versions of the php package prayno/moveon-course-catalogue-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download prayno/moveon-course-catalogue-bundle
More information about prayno/moveon-course-catalogue-bundle
Files in prayno/moveon-course-catalogue-bundle
Package moveon-course-catalogue-bundle
Short Description Set of commands to manage your course catalogue in MoveOn
License MIT
Informations about the package moveon-course-catalogue-bundle
MoveOnCourseCatalogueBundle
This is a Symfony bundle to manage your MoveOn (https://www.qs-unisolution.com/moveon/) course catalogue.
It provides 2 commands :
- import a course catalogue from a CSV file to MoveOn
- deactivate a list of courses in the MoveOn course catalogue
Installation
Install the library via Composer by running the following command:
composer require prayno/moveon-course-catalogue-bundle
Configuration
This bundle depends on the MoveOnApiBundle so you must include the configuration of this bundle too (https://github.com/PRayno/MoveOnApiBundle#configuration)
Create a config/packages/prayno_moveon_course_catalogue.yaml file in your Symfony application with the following settings :
- delimiter : CSV delimiter (default is Tab)
- latest_date_fields : array of fieldnames in your CSV file that correspond to the modification dates of the line
- required_fields : array of fieldnames in your CSV file that are required to process a line
- code_field : fieldname of the sub_institution code in MoveOn institution db table
- main_institution_id : parent institution id the sub institutions are linked to
- academic_periods : array of academic period code used to link CSV course with academic period : id (eg. 1S2019/20: 123456)
- update_courses_modified_by : only the courses modified by these users (Lastname, Firstname) will be affected by update (to avoid overriding of local modifications)
- course_identifier_regex : regex of the identifier (default external_id) used to deactivate the courses in MoveOn db which are no longer in the CSV
- excluded_lines : lines to be excluded from the process (optional).
Usage
Import from CSV
This command will create or update courses from your CSV file. The comparison for update is based on the field provided in the getIdentifier() method of your MoveOnCourse object.
bin/console moveon:course-catalog:update path/to/csv/file.csv 2019-01-01
The first argument is the path of your CSV file and the second one, the minimum date to process the line (default value : yesterday)
Deactivate courses
This command will deactivate courses based on your search criteria.
bin/console moveon:course-catalog:deactivate '{myquery}'
Example of queries :
Customization
You can customize the course object to suit your needs by creating a class implementing the PRayno\MoveOnCourseCatalogueBundle\Course\MoveonCourseInterface (or extending the default PRayno\MoveOnCourseCatalogueBundle\Course\MoveonCourse). You have to create a function with the snakecase name of the MoveOn Course attribute you want to customize like in the following example :
Then declare your class in services.yml and copy the "academic_periods" parameters in your app parameters :
This allows you to inject other services when processing the course catalogue
All versions of moveon-course-catalogue-bundle with dependencies
prayno/moveon-api-bundle Version ^1.0
symfony/framework-bundle Version ^4.0