\Roster
Class Roster
Synopsis
class Roster
extends DataObject
implements
PermissionProvider
{
- // members
- private static string $singular_name = 'Roster';
- private static string $plural_name = 'Rosters';
- private static string $description = 'Represents a working week on the roster';
- private static string $default_sort = 'StartDate DESC';
- private static array $db = ;
- private static array $summary_fields = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- private static integer $number_of_days = 5;
- // methods
- public FieldList getCMSFields()
- public string getTitle()
- public Date calculateEndDate()
- public array getHolidayArray()
- public void requireDefaultRecords()
- public static DataObject getCurrentRoster()
- public static DataObject getLatestRoster()
- public static DataObject getRosterForDate()
- public HTMLText forTemplate()
- public ArrayList getHeaderItems()
- public ArrayList getRows()
- private string getIterationHolidayClass()
- private string getIterationActiveClass()
- public void onBeforeWrite()
- public array providePermissions()
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void canView()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Tasks
Line | Task |
---|---|
21+ | : Implement number of days |
21+ | : Improve storage efficiency |
Members
private
- $db
- $default_sort
- $description
- $many_many
- $many_many_extraFields
- $number_of_days
—
int
Number of days from start date to display in roster. Max 7 - $plural_name
- $singular_name
- $summary_fields
Methods
private
- getIterationActiveClass() — Returns either 'active' or '' for use in Template
- getIterationHolidayClass() — Returns either 'holiday' or '' for use in Template
public
- calculateEndDate()
- canCreate()
- canDelete()
- canEdit()
- canView()
- forTemplate() — Render with a custom template
- getCMSFields()
- getCurrentRoster()
- getHeaderItems() — Template helper - Returns the start date, then the rest of the columns' dates
- getHolidayArray()
- getLatestRoster() — Uses the default sort on Roster to return the most recent one
- getRosterForDate() — Return a roster for a particular date
- getRows() — Roster row display for template
- getTitle()
- onBeforeWrite() — Set the end date
- providePermissions()
- requireDefaultRecords() — Creates default Staff Member group