public function onCountTimesTableColumns(int $columns, array $options) : int

Fires while fetching the number of columns to display within the employees list availability table.


Description

Under the Listings » Employees section of the configuration, it is possible to find a setting called AJAX Search. Depending on how this setting is configured, the system might display an availability table for each employee under the Employees List page in the front-end.

This hook triggers to alter the number of columns to display at runtime.


Parameters

$columns

(int)  The default number of columns (4).

$options

(array)  An array of search options.

  • id_ser - the ID of the selected service, if any;
  • date - the initial check-in date (the current one by default);
  • people - the selected number of participants, if any.

Return Value

Integer. The number of columns to display. It is suggested to use a value between 2 and 5.


Example

/**
 * Trigger hook to alter the number of columns to display within the
 * timeline displayed by the employees list page.
 *
 * @param   integer  $columns  The default number of columns.
 * @param   array    $options  An array of search options.
 *
 * @return  integer  The number of columns to display.
 */
public function onCountTimesTableColumns($columns, $options)
{
    // always display 3 columns
    return 3;
}

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-06 16:14
Helpful?