Calendar event template

Calendar event template

by Wasim Fadloun -
Number of replies: 4

Dear Sir, thank you for the wonderful plugin,

I have a question please, is there an easy way to add the student's user ID to the body or the subject of the saved calendar event ?

something like 'You have a meeting with your student John Smith [ 10011].

thanks

Average of ratings: -
In reply to Wasim Fadloun

Re: Calendar event template

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

To achieve this, you would need to modify the code. I think the method scheduler_slot->update_calendar() is what you would need to look at, in the file mod/scheduler/model/scheduler_slot.php .

In reply to Henning Bostelmann

Re: Calendar event template

by Wasim Fadloun -

Thanks for the reply,

I am sure anyone with little php knowledge could do it , but I have no experience in php, I tried to read the code and analyse the function that assembles the event object with no luck.

I appreciate if you can provide any further help.

In reply to Wasim Fadloun

Re: Calendar event template

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

I think the best way to achieve this would be to modify the following lines:

 foreach ($students as $student) {
          $studentnames[] = fullname($student);
 }

Here "fullname($student)" should be replaced with:

fullname($student).' ['.$student->id.']'

However, you should really only modify the code if you have the experience to do so.

In reply to Henning Bostelmann

Re: Calendar event template

by Wasim Fadloun -

Thanks Henning,

I have managed to fix this, with help from a  collegue.

foreach ($students as $student) {
   $studentnames[] = $student->username." - ".fullname($student);
}


this will show [username-FullName], in my system the username is the student academic ID.


Thank you again for this amazing plugin and committed support.

-Wasim