ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\Calendar\ConsultationHours\BookingTableGUI Class Reference
+ Inheritance diagram for ILIAS\Calendar\ConsultationHours\BookingTableGUI:
+ Collaboration diagram for ILIAS\Calendar\ConsultationHours\BookingTableGUI:

Public Member Functions

 __construct (BookingDataProvider $provider)
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 get ()
 
 render ()
 

Data Fields

const ACTION_TOKEN = 'action'
 
const ID_TOKEN = 'id'
 
const TABLE_NS = 'ch_booking_table'
 
const ACTION_TOKEN_NS = self::TABLE_NS . '_' . self::ACTION_TOKEN
 
const ID_TOKEN_NS = self::TABLE_NS . '_' . self::ID_TOKEN
 

Protected Member Functions

 getActions ()
 
 getColumns ()
 

Protected Attributes

BookingDataProvider $provider
 
readonly ilLanguage $lng
 
readonly ilObjUser $user
 
readonly ilCtrl $ctrl
 
readonly UIFactory $ui_factory
 
readonly DataFactory $data_factory
 
readonly ServerRequestInterface $http_request
 
Renderer $ui_renderer
 

Detailed Description

Definition at line 38 of file BookingTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::__construct ( BookingDataProvider  $provider)

Definition at line 60 of file BookingTableGUI.php.

References $DIC, ILIAS\Calendar\ConsultationHours\BookingTableGUI\$provider, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

61  {
62  global $DIC;
63 
64  $this->provider = $provider;
65 
66  $this->lng = $DIC->language();
67  $this->user = $DIC->user();
68  $this->ctrl = $DIC->ctrl();
69 
70  $this->http_request = $DIC->http()->request();
71  $this->ui_factory = $DIC->ui()->factory();
72  $this->data_factory = new DataFactory();
73  $this->ui_renderer = $DIC->ui()->renderer();
74  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ get()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::get ( )

Definition at line 103 of file BookingTableGUI.php.

References ILIAS\Calendar\ConsultationHours\BookingTableGUI\getActions(), ILIAS\Calendar\ConsultationHours\BookingTableGUI\getColumns(), and ILIAS\Repository\lng().

103  : Data
104  {
105  return $this->ui_factory
106  ->table()
107  ->data(
108  $this->lng->txt('cal_ch_ch'),
109  $this->getColumns(),
110  $this
111  )
112  ->withId(self::class)
113  ->withActions($this->getActions())
114  ->withRequest($this->http_request);
115  }
+ Here is the call graph for this function:

◆ getActions()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getActions ( )
protected
Returns
array<string, >

Definition at line 121 of file BookingTableGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\ConsultationHours\BookingTableGUI\get().

121  : array
122  {
123  $uri_command_handler = $this->data_factory->uri(
124  ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(
125  ilConsultationHoursGUI::class,
126  'handleBookingTableActions'
127  )
128  );
129 
130  [
131  $url_builder,
132  $action_parameter_token,
133  $row_id_token
134  ] =
135  (new URLBuilder($uri_command_handler))->acquireParameters(
136  [self::TABLE_NS],
137  self::ACTION_TOKEN,
138  self::ID_TOKEN
139  );
140 
141  return [
142  'edit' => $this->ui_factory->table()->action()->standard(
143  $this->lng->txt('edit'),
144  $url_builder->withParameter($action_parameter_token, 'edit'),
145  $row_id_token
146  ),
147  'searchUsersForAppointments' => $this->ui_factory->table()->action()->standard(
148  $this->lng->txt('cal_ch_assign_participants'),
149  $url_builder->withParameter($action_parameter_token, 'searchUsersForAppointments'),
150  $row_id_token
151  ),
152  'confirmCancelBooking' => $this->ui_factory->table()->action()->single(
153  $this->lng->txt('cal_ch_cancel_booking'),
154  $url_builder->withParameter($action_parameter_token, 'confirmCancelBooking'),
155  $row_id_token
156  )->withAsync(true),
157  'confirmDeleteBooking' => $this->ui_factory->table()->action()->single(
158  $this->lng->txt('cal_ch_delete_booking'),
159  $url_builder->withParameter($action_parameter_token, 'confirmDeleteBooking'),
160  $row_id_token
161  )->withAsync(true),
162  'confirmDeleteAppointments' => $this->ui_factory->table()->action()->standard(
163  $this->lng->txt('delete'),
164  $url_builder->withParameter($action_parameter_token, 'confirmDeleteAppointments'),
165  $row_id_token
166  )->withAsync(true),
167  'sendMail' => $this->ui_factory->table()->action()->standard(
168  $this->lng->txt('cal_ch_send_mail'),
169  $url_builder->withParameter($action_parameter_token, 'sendMail'),
170  $row_id_token
171  )
172  ];
173  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumns()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getColumns ( )
protected
Returns
array<string, >

Definition at line 178 of file BookingTableGUI.php.

References ILIAS\Repository\lng(), ilCalendarSettings\TIME_FORMAT_12, and ILIAS\Repository\user().

Referenced by ILIAS\Calendar\ConsultationHours\BookingTableGUI\get().

178  : array
179  {
180  if ($this->user->getTimeFormat() === \ilCalendarSettings::TIME_FORMAT_12) {
181  $format = $this->data_factory->dateFormat()->withTime12($this->user->getDateFormat());
182  } else {
183  $format = $this->data_factory->dateFormat()->withTime24($this->user->getDateFormat());
184  }
185 
186  return [
187  'booking_start' => $this->ui_factory
188  ->table()
189  ->column()
190  ->date($this->lng->txt('cal_ch_booking_start'), $format)
191  ->withIsSortable(true),
192  'booking_duration' => $this->ui_factory
193  ->table()
194  ->column()
195  ->number($this->lng->txt('cal_ch_minutes'))
196  ->withIsSortable(true),
197  'booking_title' => $this->ui_factory
198  ->table()
199  ->column()
200  ->text($this->lng->txt('title'))
201  ->withIsSortable(true),
202  'booking_participant' => $this->ui_factory
203  ->table()
204  ->column()
205  ->linkListing($this->lng->txt('cal_ch_booking_participants')),
206  'booking_comment' => $this->ui_factory
207  ->table()
208  ->column()
209  ->linkListing($this->lng->txt('cal_ch_booking_col_comments')),
210  'booking_location' => $this->ui_factory
211  ->table()
212  ->column()
213  ->linkListing($this->lng->txt('cal_ch_target_object'))
214  ];
215 
216  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRows()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $additional_parameters 
)

This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildStandardRow($row_id, $record).

Parameters
string[]$visible_column_ids

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 76 of file BookingTableGUI.php.

References $id, and ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow().

83  : Generator {
84  $records = $this->provider->limitData($range, $order);
85  foreach ($records as $row) {
86  $id = $row['id'];
87  $records_row = $row_builder->buildDataRow($id, $row);
88  if (count($row['booking_participant']->getItems()) === 0) {
89  $records_row = $records_row
90  ->withDisabledAction('confirmCancelBooking')
91  ->withDisabledAction('confirmDeleteBooking')
92  ->withDisabledAction('sendMail');
93  }
94  yield $records_row;
95  }
96  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 98 of file BookingTableGUI.php.

98  : ?int
99  {
100  return count($this->provider->getData());
101  }

◆ render()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::render ( )

Definition at line 218 of file BookingTableGUI.php.

218  : string
219  {
220  return $this->ui_renderer->render(
221  [
222  $this->get()
223  ]
224  );
225  }

Field Documentation

◆ $ctrl

readonly ilCtrl ILIAS\Calendar\ConsultationHours\BookingTableGUI::$ctrl
protected

Definition at line 53 of file BookingTableGUI.php.

◆ $data_factory

readonly DataFactory ILIAS\Calendar\ConsultationHours\BookingTableGUI::$data_factory
protected

Definition at line 55 of file BookingTableGUI.php.

◆ $http_request

readonly ServerRequestInterface ILIAS\Calendar\ConsultationHours\BookingTableGUI::$http_request
protected

Definition at line 56 of file BookingTableGUI.php.

◆ $lng

readonly ilLanguage ILIAS\Calendar\ConsultationHours\BookingTableGUI::$lng
protected

Definition at line 51 of file BookingTableGUI.php.

◆ $provider

BookingDataProvider ILIAS\Calendar\ConsultationHours\BookingTableGUI::$provider
protected

◆ $ui_factory

readonly UIFactory ILIAS\Calendar\ConsultationHours\BookingTableGUI::$ui_factory
protected

Definition at line 54 of file BookingTableGUI.php.

◆ $ui_renderer

Renderer ILIAS\Calendar\ConsultationHours\BookingTableGUI::$ui_renderer
protected

Definition at line 57 of file BookingTableGUI.php.

◆ $user

readonly ilObjUser ILIAS\Calendar\ConsultationHours\BookingTableGUI::$user
protected

Definition at line 52 of file BookingTableGUI.php.

◆ ACTION_TOKEN

const ILIAS\Calendar\ConsultationHours\BookingTableGUI::ACTION_TOKEN = 'action'

Definition at line 40 of file BookingTableGUI.php.

◆ ACTION_TOKEN_NS

const ILIAS\Calendar\ConsultationHours\BookingTableGUI::ACTION_TOKEN_NS = self::TABLE_NS . '_' . self::ACTION_TOKEN

Definition at line 44 of file BookingTableGUI.php.

◆ ID_TOKEN

const ILIAS\Calendar\ConsultationHours\BookingTableGUI::ID_TOKEN = 'id'

Definition at line 41 of file BookingTableGUI.php.

◆ ID_TOKEN_NS

const ILIAS\Calendar\ConsultationHours\BookingTableGUI::ID_TOKEN_NS = self::TABLE_NS . '_' . self::ID_TOKEN

Definition at line 46 of file BookingTableGUI.php.

◆ TABLE_NS

const ILIAS\Calendar\ConsultationHours\BookingTableGUI::TABLE_NS = 'ch_booking_table'

Definition at line 42 of file BookingTableGUI.php.


The documentation for this class was generated from the following file: