Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
CalendarScheduleModel Class Reference

Static Public Member Functions

static storeEntry ($data)
 
static storeSeminarEntry ($data)
 
static deleteEntry ($id)
 
static getScheduleEntries ($user_id, $start_hour, $end_hour, $id=false)
 
static getSeminarEntry ($seminar_id, $user_id, $cycle_id=false, $semester=false)
 
static deleteSeminarEntries ($user_id, $seminar_id)
 
static getSeminarEntries ($user_id, $semester, $start_hour, $end_hour, $show_hidden=false)
 
static getSeminarEntriesForInstitute ($user_id, $semester, $start_hour, $end_hour, $institute_id)
 
static getSeminarCycleId (Seminar $seminar, $start, $end, $day)
 
static isSeminarVisible ($seminar_id, $cycle_id)
 
static getInstituteEntries ($user_id, $semester, $start_hour, $end_hour, $institute_id, $days, $show_hidden=false)
 
static getEntries ($user_id, $semester, $start_hour, $end_hour, $days, $show_hidden=false)
 
static addDayChooser ($entries, $days, $controller= 'schedule')
 
static adminBind ($seminar_id, $cycle_id, $visible=true)
 
static unbind ($seminar_id, $cycle_id=null)
 
static bind ($seminar_id, $cycle_id)
 
static getScheduleSettings ($user_id=false)
 
static getDisplayedDays (array $input)
 
static getCurrentSemester ()
 
static getInstCalendarView ($institute_id, $show_hidden=false, $semester=false, $days=false)
 
static getUserCalendarView ($user_id, $show_hidden=false, $semester=false, $days=false)
 

Detailed Description

Pseudo-namespace containing helper methods for the schedule.

Since
2.0

Member Function Documentation

static addDayChooser (   $entries,
  $days,
  $controller = 'schedule' 
)
static

adds title and link to CalendarColumn-objects and sorts the objects to be displayed correctly in the calendar-view

Parameters
array$entriesan array of CalendarColumn-objects
array$daysan array of int's, denoting the days to be displayed
Returns
array
static adminBind (   $seminar_id,
  $cycle_id,
  $visible = true 
)
static

Toggle entries' visibility

Parameters
string$seminar_idthe course's ID
string$cycle_idthe cycle's ID
bool$visiblethe value to switch to
Returns
void
static bind (   $seminar_id,
  $cycle_id 
)
static

Switch a seminars' cycle to visible.

Parameters
string$seminar_idthe course's ID
string$cycle_idthe cycle's ID
Returns
void
static deleteEntry (   $id)
static

delete the entry with the submitted id, belonging to the current user

Parameters
string$id
Returns
void
static deleteSeminarEntries (   $user_id,
  $seminar_id 
)
static

Deletes the schedule entries of one user for one seminar.

Parameters
string$user_idthe user of the schedule
string$seminar_idthe seminar which entries should be deleted
static getCurrentSemester ( )
static

Return the semester-entry for the current semester

Returns
mixed the current semester
static getDisplayedDays ( array  $input)
static

Transforms day settings from SCHEDULE_SETTINGS::glb_days to valid days that can be displayed.

Parameters
array$inputInput from SCHEDULE_SETTINGS
Returns
array
static getEntries (   $user_id,
  $semester,
  $start_hour,
  $end_hour,
  $days,
  $show_hidden = false 
)
static
Parameters
string$user_id
mixed$semesterthe data for the semester to be displayed Returns an array of CalendarColumn's, containing the seminar-entries for the passed user (in the passed semester) and the user-defined schedule-entries. The start- and end-hour are used to constrain the returned entries to the passed time-period. The passed days constrain the entries to these. Seminar-entries can be hidden, so you can opt-in to fetch the hidden ones as well.
string$user_idthe user's ID
string$semesterthe data for the semester to be displayed
int$start_hourthe start hour of the entries
int$end_hourthe end hour of the entries
array$daysdays to be displayed
bool$show_hiddenfilters hidden entries
Returns
array
static getInstCalendarView (   $institute_id,
  $show_hidden = false,
  $semester = false,
  $days = false 
)
static

Create a CalendarWeekView (a schedule) for an institute for the current user and return it.

Parameters
string$institute_idthe institute to get the calendar for
bool$show_hiddenshow hidden entries
mixed$semesterthe semester to use
mixed$daysthe days to consider
Returns
CalendarWeekView
static getInstituteEntries (   $user_id,
  $semester,
  $start_hour,
  $end_hour,
  $institute_id,
  $days,
  $show_hidden = false 
)
static

Returns an array of CalendarColumn's, containing the seminar-entries for the passed user (in the passed semester belonging to the passed institute) and the user-defined schedule-entries. The start- and end-hour are used to constrain the returned entries to the passed time-period. The passed days constrain the entries to these. Seminar-entries can be hidden, so you can opt-in to fetch the hidden ones as well.

Parameters
string$user_idthe user's ID
string$semesterthe data for the semester to be displayed
int$start_hourthe start hour of the entries
int$end_hourthe end hour of the entries
string$institute_idthe institute's ID
array$daysdays to be displayed
bool$show_hiddenfilters hidden entries
Returns
array an array of entries
static getScheduleEntries (   $user_id,
  $start_hour,
  $end_hour,
  $id = false 
)
static

Returns an array of CalendarColumn's containing the schedule entries (optionally of a given id only). The start- and end-hour are used to constrain the returned entries to the passed time-period. If you pass an id, there will be only the single entry with that id in the CalendarColumn

Parameters
string$user_idthe ID of the user
int$start_hourthe start hour
int$end_hourthe end hour
string$idoptional; the ID of the schedule-entry
Returns
array an array containing the entries
static getScheduleSettings (   $user_id = false)
static

Get the schedule_settings from the user's config

Parameters
string$user_idthe user to get the settings for, defaults to current user
Returns
mixed the settings
static getSeminarCycleId ( Seminar  $seminar,
  $start,
  $end,
  $day 
)
static

Returns the ID of the cycle of a course specified by start and end.

Parameters
Seminar$seminaran instance of a Seminar
string$startthe start of the cycle
string$endthe end of the cycle
Returns
string $day numeric day
static getSeminarEntries (   $user_id,
  $semester,
  $start_hour,
  $end_hour,
  $show_hidden = false 
)
static

Returns an array of CalendarColumn's, containing the seminar-entries for the passed user in the passed semester. The start- and end-hour are used to constrain the returned entries to the passed time-period. Seminar-entries can be hidden, so you can opt-in to fetch the hidden ones as well.

Parameters
string$user_idthe ID of the user
string$semesteran array containing the "beginn" of the semester
int$start_hourthe start hour
int$end_hourthe end hour
string$show_hiddenoptional; true to show hidden, false otherwise
Returns
array an array containing the properties of the entry
static getSeminarEntriesForInstitute (   $user_id,
  $semester,
  $start_hour,
  $end_hour,
  $institute_id 
)
static

Returns an array of CalendarColumn's, containing the seminar-entries for the passed user in the passed semester belonging to the passed institute. The start- and end-hour are used to constrain the returned entries to the passed time-period.

Parameters
string$user_idthe ID of the user
array$semesteran array containing the "beginn" of the semester
int$start_hourthe start hour
int$end_hourthe end hour
string$institute_idthe ID of the institute
Returns
array an array containing the entries
static getSeminarEntry (   $seminar_id,
  $user_id,
  $cycle_id = false,
  $semester = false 
)
static

Return an entry for the specified course.

Parameters
string$seminar_idthe ID of the course
string$user_idthe ID of the user
mixed$cycle_ideither false or the ID of the cycle
mixed$semesterfilter for this semester
Returns
array the course's entry
static getUserCalendarView (   $user_id,
  $show_hidden = false,
  $semester = false,
  $days = false 
)
static

Create a CalendarWeekView (a schedule) for the current user and return it.

Parameters
string$user_idthe institute to get the calendar for
bool$show_hiddenshow hidden entries
mixed$semesterthe semester to use
mixed$daysthe days to consider
Returns
CalendarWeekView
static isSeminarVisible (   $seminar_id,
  $cycle_id 
)
static

check if the passed cycle of the passed id is visible for the currently logged in user int the schedule

Parameters
stringthe ID of the course
stringthe ID of the cycle
Returns
bool true if visible, false otherwise
static storeEntry (   $data)
static

update an existing entry or -if $data['id'] is not set- create a new entry

Parameters
mixed$data
static storeSeminarEntry (   $data)
static

Update an existing entry of a course or create a new entry if $data['id'] is not set

Parameters
mixed$datathe data to store
Returns
void
static unbind (   $seminar_id,
  $cycle_id = null 
)
static

Switch a seminars' cycle to invisible.

Parameters
string$seminar_idthe course's ID
string$cycle_idthe cycle's ID
Returns
void

The documentation for this class was generated from the following file: