Module: manage_time_slots

Contains the functionalities related to the manage time slots page.
Author:
  • Joonas Konki
  • Anu Koskela
  • Mikko Kuhno
  • Henrik Paananen
  • Atte Räty
License:
  • BSD 3-clause, see LICENSE for more details.
Source:

Methods

(static) addExperimentsInfo(timeslot, index, parent)

Displays the students and additional information related to the time slot in a list element.
Parameters:
Name Type Description
timeslot object The time slot for which the information is related to.
index number The index of the wanted unit.
parent object The element where the information is added.
Source:

(static) calendarClick(event, element, view)

Gets the selected calendar timeslot event.
Parameters:
Name Type Description
event Contains the event information.
element Contains information what kind of. element the clicked event is
view Contains the viewmode in which the element is shown.
Source:

(static) calendarEventRender(event, element, view)

Renders the selected timeslots to the calendar.
Parameters:
Name Type Description
event Contains the event information.
element Contains information what kind of element the event is.
view Contains the viewmode in which the element is shown.
Source:

(static) doc_ready()

This is executed after the HTML page has been loaded. This is a common procedure of all of the client-side modules to initialise the page content.
Source:

(static) getNumberOfReservations(timeslot) → {number}

Returns the number of reservations made to the given time slot.
Parameters:
Name Type Description
timeslot object The current time slot.
Source:
Returns:
- The number of reservations the time slot has.
Type
number

(static) getSelectedSupervisors()

Returns a list of the selected supervisors.
Source:

(static) initCalendar(timeslot, data)

Initialises the calendar with the given custom attributes.
Parameters:
Name Type Description
timeslot The timeslots to render to the calendar.
data The data to initialise the calendar with.
Source:

(static) initTable()

Creates a table that displays all the time slots and a toggleable area for each of the time slot which have reservations. The toggleable area includes the information of the reserved unit groups and of the participants. Adds a button and a listener for each upcoming time slot, which enables cancelling the time slot.
Source:

(static) reloadTimeSlots()

Gets the time slots from the database and updates the timeSlotList.
Source:

(static) saveTimeSlot()

Gets the information from all editable fields and makes a call to save the new time slot with the gathered information.
Source:

(static) updateCalendar()

Initialises and updates the calendar.
Source:

(static) updateNewReservationForm()

Empties all of the editable fields related to creating a new reservation. Fetches time slots from the database and updates the study level selection.
Source:

(static) updateSupervisors(supervisors, studyTypeId)

Empties the supervisor selector and fills it with those supervisors whose user role matches the selected study level.
Parameters:
Name Type Description
supervisors object A list of all available users who have the user role "supervisor".
studyTypeId string The ID of the selected study level.
Source:

(static) updateTable()

Shows the wanted time slots based on which options (past, present, future) are checked and hides the rest. If no time slots match the selected time frame, shows a notification.
Source:

(inner) modalButtonYes click()

Makes a call to the database to cancel the current time slot.
Source:

(inner) toggleCalendarBtn click()

Toggles between the calendar and list views when the button is clicked.
Source: