All
I needed a way to make an individual session unavailable for booking. Basically the instructor wanted to add students to specific sessions manually without the student signing up themselves. To do this I changed the code in face-to-face/lib.php as shown below:
// Only numbers allowed here
$session->capacity = preg_replace('/[^\d]/', '', $session->capacity);
$MAX_CAPACITY = 100000;
if ($session->capacity < 0) { //changed from a 1 to a 0 to allow session capacity to be set to 0 so sessions can be closed.
$session->capacity = 1;
}
elseif ($session->capacity > $MAX_CAPACITY) {
$session->capacity = $MAX_CAPACITY;
}
The scenario is this: The instructor has a session that has 25 seats, but 15 of those seats need to be held for a specific department. Once those 15 seats are filled then the instructor opens the session for anyone else that wants to register. Setting the capacity to 0 effectively allows the session to be created but makes the session unavailable for students to book. The instructor(s) adds the 15 students from the department and then two weeks before class starts they change the capacity to the actual capacity of the class opening up the remaining seats to whoever wants to book it.
I hope I have explained this well. In my testing it seems to be working beautifully, I just wonder if I am breaking something else by doing this. ANy thoughts of comments?
Scott Karren