Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

View user acceptances to the policies

Copyright: 2018 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html 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
Constructor.

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
downloading.


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
downloading.


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
Helper.


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