I have modified the external database enroll procedures to work better with our implementation of SCT PowerCampus.
At our university we use SCT PowerCampus as our ERP solution. All of our student and faculty information as well as information on class offerings is stored in PowerCampus. I wanted to be able to use the External Database enrolment module to import this data into Moodle but it was insufficient for our purposes.
I started with a patch file created by Iñaki Arenaza. This was a great help.
This patch adds access to a second external database and additional fields like course summary, course category, etc.
I added course start date and end dates. I use this information to assign a start date to a course, calculate the number of weeks a course will run and set the visibility attribute for the course (Courses are not visible to students until the start date of the course). I also added code to auto create the course category if it does not exist, as well as an option not to auto create categories.
I had our DBA create two views to extract the data from PowerCampus that was needed for the integration with Moodle. PowerCampus database structure is somewhat convoluted and is very difficult to work with.
The first view gives me enrollment information for each class. It was necessary to use a union because information about faculty and students are stored in different tables. The second view gives me information about a specific class.
I have included the queries for the views along with the modified Moodle files.