Class acceptances_table.
More...
|
| __construct ($uniqueid, acceptances_filter $acceptancesfilter, renderer $output) |
| Constructor.
|
|
| col_country ($data) |
| Generate the country column.
|
|
| col_fullname ($row) |
| Get the column fullname value.
|
|
| col_note ($row) |
| Get the column note value.
|
|
| col_statusall ($row) |
| Get the column statusall value.
|
|
| col_timemodified ($row) |
| Get the column timemodified value.
|
|
| display () |
| Render the table.
|
|
| download () |
| Download the data.
|
|
| format_row ($row) |
| Call appropriate methods on this table class to perform any processing on values before displaying in table.
|
|
| get_sort_columns () |
| Remove randomness from the list by always sorting by user id in the end.
|
|
| get_sql_where () |
| Get sql to add to where statement.
|
|
| other_cols ($column, $row) |
| You can override this method in a child class.
|
|
| wrap_html_finish () |
| Hook that can be overridden in child classes to wrap a table in a form for example.
|
|
| wrap_html_start () |
| Hook that can be overridden in child classes to wrap a table in a form for example.
|
|
|
| add_column_header ($key, $label, $sortable=true, $columnclass='') |
| Allows to add only one column name and header to the table (parent class methods only allow to set all).
|
|
| build_sql_for_capability_filter () |
| If there is a filter to find users who can/cannot accept on their own behalf add it to the SQL query.
|
|
| build_sql_for_roles_filter () |
| If there is a filter by user roles add it to the SQL query.
|
|
| build_sql_for_search_string ($userfields) |
| Helper SQL query builder.
|
|
| configure_for_multiple_versions () |
| Helper configuration method.
|
|
| configure_for_single_version () |
| Helper configuration method.
|
|
| get_return_url () |
| Helper.
|
|
| sql_has_role ($roles, $positive=true) |
| Returns SQL snippet for users that have (do not have) one of the given roles in the system context.
|
|
| status ($versionid, $row) |
| Return agreement status.
|
|
| username ($user, $profilelink=true) |
| User name with a link to profile.
|
|
|
acceptances_filter | $acceptancesfilter |
|
bool | $canagreeany = false |
| are there any users that this user can agree on behalf of
|
|
string[] | $countries |
| The list of countries.
|
|
renderer | $output |
|
array | $versionids |
|
Class acceptances_table.
- Copyright
- 2018 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
Constructor.
- Parameters
-
string | $uniqueid | Table identifier. |
acceptances_filter | $acceptancesfilter | |
renderer | $output | |
◆ add_column_header()
tool_policy\acceptances_table::add_column_header |
( |
| $key, |
|
|
| $label, |
|
|
| $sortable = true, |
|
|
| $columnclass = '' ) |
|
protected |
Allows to add only one column name and header to the table (parent class methods only allow to set all).
- Parameters
-
string | $key | |
string | $label | |
bool | $sortable | |
string | $columnclass | |
◆ build_sql_for_search_string()
tool_policy\acceptances_table::build_sql_for_search_string |
( |
| $userfields | ) |
|
|
protected |
Helper SQL query builder.
- Parameters
-
◆ col_country()
tool_policy\acceptances_table::col_country |
( |
| $data | ) |
|
Generate the country column.
- Parameters
-
- Return values
-
◆ col_fullname()
tool_policy\acceptances_table::col_fullname |
( |
| $row | ) |
|
Get the column fullname value.
- Parameters
-
- Return values
-
◆ col_note()
tool_policy\acceptances_table::col_note |
( |
| $row | ) |
|
Get the column note value.
- Parameters
-
- Return values
-
◆ col_statusall()
tool_policy\acceptances_table::col_statusall |
( |
| $row | ) |
|
Get the column statusall value.
- Parameters
-
- Return values
-
◆ col_timemodified()
tool_policy\acceptances_table::col_timemodified |
( |
| $row | ) |
|
Get the column timemodified value.
- Parameters
-
- Return values
-
◆ format_row()
tool_policy\acceptances_table::format_row |
( |
| $row | ) |
|
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'.
- Parameters
-
array | object | $row | row of data from db used to make one row of the table. |
- Return values
-
array | one row for the table, added using add_data_keyed method. |
◆ get_sort_columns()
tool_policy\acceptances_table::get_sort_columns |
( |
| ) |
|
Remove randomness from the list by always sorting by user id in the end.
- Return values
-
◆ get_sql_where()
tool_policy\acceptances_table::get_sql_where |
( |
| ) |
|
Get sql to add to where statement.
- Return values
-
◆ other_cols()
tool_policy\acceptances_table::other_cols |
( |
| $column, |
|
|
| $row ) |
You can override this method in a child class.
See the description of build_table which calls this method.
- Parameters
-
string | $column | |
stdClass | $row | |
- Return values
-
◆ sql_has_role()
tool_policy\acceptances_table::sql_has_role |
( |
| $roles, |
|
|
| $positive = true ) |
|
protected |
Returns SQL snippet for users that have (do not have) one of the given roles in the system context.
- Parameters
-
array | $roles | list of roles indexed by role id |
bool | $positive | true: return users who HAVE roles; false: return users who DO NOT HAVE roles |
- Return values
-
◆ status()
tool_policy\acceptances_table::status |
( |
| $versionid, |
|
|
| $row ) |
|
protected |
Return agreement status.
- Parameters
-
int | $versionid | either id of an individual version or empty for overall status |
stdClass | $row | |
- Return values
-
◆ username()
tool_policy\acceptances_table::username |
( |
| $user, |
|
|
| $profilelink = true ) |
|
protected |
User name with a link to profile.
- Parameters
-
stdClass | $user | |
bool | $profilelink | show link to profile (when we are downloading never show links) |
- Return values
-
◆ wrap_html_finish()
tool_policy\acceptances_table::wrap_html_finish |
( |
| ) |
|
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_start()
tool_policy\acceptances_table::wrap_html_start |
( |
| ) |
|
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.
The documentation for this class was generated from the following file:
- admin/tool/policy/classes/acceptances_table.php