Module: new_reservation

Contains the functionalities related to the new reservations 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) 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 view in which the element is shown.
Source:

(static) calendarEventRender(event, element, view, eventData)

Shows information related to the FullCalendar event. The selection is highlighted if the event selection is active in the calendar view.
Parameters:
Name Type Description
event Contains the event information.
element Contains information what kind of element the clicked event is.
view Contains the view in which the element is shown.
eventData Contains the data that the event has.
Source:

(static) checkGroupSize(groups)

Shows a notification if the selected user group is bigger than the defined maximum number of participants for the unit group.
Parameters:
Name Type Description
groups object A list of all user groups.
Source:

(static) displayUnitDescription()

Sets the unit's name and other information to the corresponding areas.
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) initCalendar()

Initialises the calendar with the given custom attributes.
Source:

(static) initList()

Creates a table row element for each available time slot.
Source:

(static) selectCalendarTimeslot(timeslot)

Selects the clicked calendar timeslot event.
Parameters:
Name Type Description
timeslot object The selected timeslot.
Source:

(static) showPickTimeArea()

Shows the calendar to pick a suitable time for the reservation after the work selection has been made. Initialises the calendar if it is null.
Source:

(static) toggleViewButton click()

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

(static) unitDisplayName(unit) → {string}

Pastes the unit group, identified and name of the unit together into one string for better readability.
Parameters:
Name Type Description
unit object The selected unit.
Source:
Returns:
- The names of the unit group, qualifier and unit.
Type
string

(static) updateCalendar()

Clears the calendar and refetches the events.
Source:

(static) updateUnitList(inputText)

Fills the unitList with the units that match the given string.
Parameters:
Name Type Description
inputText string The string that has to be found in the name of each displayed unit.
Source:

(inner) makeReservationBtn click()

Gets the additional information from the extraInfo field and calls the function addReservation at kepler.js to save the reservation with the provided parameters.
Source:

(inner) newReservationSelectGroup change()

Displays the members of the selected user group and calls the function checkGroupSize.
Source:

(inner) unitList change()

Displays the unit's description, check the size of the selected user group and updates the available time slots shown in the calendar or the list view.
Source: