I'm using moodle 3 and I have configured external database enrolments and also auto creation of new courses.
Currently it seems that the "New course template" is a static value and it would be nice to have the ability to define the template through a database's field.
I have already created an initial (quick n' dirty) patch available at
https://github.com/jsalatas/moodle/commit/b73c7829de48097c346817a50c3404d07ba4f718
which treats this template name as a database field. Obviously it isn't backward compatible (for existing installations) for users who already had the the "New course template" set up, but I'm planning to fix it.
As I commented in the bug tracker
https://tracker.moodle.org/browse/MDL-54792
I see two possible ways to go here
1) Having two fields one as it is now that the user can enter a
template's name and a second one that the user can enter a database
field name containing the template's name
2) Just one template field and one checkbox something like "Template is
database field". The checkbox's default value would be unchecked (so
that it works as it currently does) and when checked the template's
textbox would map to a database field.
IMHO, 2nd ways (a single textbox and a checkbox) would make more sense than having two different textboxes which only one could contain a value.
I would appreciate your feedback.
Thanks!