Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

View user acceptances to the policies

Copyright: 2018 Marina Glancy
License: GNU GPL v3 or later
File Size: 649 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Class: acceptances_table  - X-Ref

Class acceptances_table

__construct($uniqueid, acceptances_filter $acceptancesfilter, renderer $output)   X-Ref

param: string $uniqueid Table identifier.
param: acceptances_filter $acceptancesfilter
param: renderer $output

get_sort_columns()   X-Ref
Remove randomness from the list by always sorting by user id in the end

return: array

add_column_header($key, $label, $sortable = true, $columnclass = '')   X-Ref
Allows to add only one column name and header to the table (parent class methods only allow to set all).

param: string $key
param: string $label
param: bool $sortable
param: string $columnclass

configure_for_single_version()   X-Ref
Helper configuration method.

configure_for_multiple_versions()   X-Ref
Helper configuration method.

download()   X-Ref
Download the data.

get_sql_where()   X-Ref
Get sql to add to where statement.

return: string

build_sql_for_search_string($userfields)   X-Ref
Helper SQL query builder.

param: array $userfields

build_sql_for_capability_filter()   X-Ref
If there is a filter to find users who can/cannot accept on their own behalf add it to the SQL query

sql_has_role($roles, $positive = true)   X-Ref
Returns SQL snippet for users that have (do not have) one of the given roles in the system context

param: array $roles list of roles indexed by role id
param: bool $positive true: return users who HAVE roles; false: return users who DO NOT HAVE roles
return: string

build_sql_for_roles_filter()   X-Ref
If there is a filter by user roles add it to the SQL query.

wrap_html_start()   X-Ref
Hook that can be overridden in child classes to wrap a table in a form
for example. Called only when there is data to display and not

wrap_html_finish()   X-Ref
Hook that can be overridden in child classes to wrap a table in a form
for example. Called only when there is data to display and not

display()   X-Ref
Render the table.

format_row($row)   X-Ref
Call appropriate methods on this table class to perform any processing on values before displaying in table.
Takes raw data from the database and process it into human readable format, perhaps also adding html linking when
displaying table as html, adding a div wrap, etc.

See for example col_fullname below which will be called for a column whose name is 'fullname'.

param: array|object $row row of data from db used to make one row of the table.
return: array one row for the table, added using add_data_keyed method.

col_fullname($row)   X-Ref
Get the column fullname value.

param: stdClass $row
return: string

username($user, $profilelink = true)   X-Ref
User name with a link to profile

param: stdClass $user
param: bool $profilelink show link to profile (when we are downloading never show links)
return: string

get_return_url()   X-Ref

status($versionid, $row)   X-Ref
Return agreement status

param: int $versionid either id of an individual version or empty for overall status
param: stdClass $row
return: string

col_timemodified($row)   X-Ref
Get the column timemodified value.

param: stdClass $row
return: string

col_note($row)   X-Ref
Get the column note value.

param: stdClass $row
return: string

col_statusall($row)   X-Ref
Get the column statusall value.

param: stdClass $row
return: string

col_country($data)   X-Ref
Generate the country column.

param: \stdClass $data
return: string

other_cols($column, $row)   X-Ref
You can override this method in a child class. See the description of
build_table which calls this method.

param: string $column
param: stdClass $row
return: string