ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 39 of file BookingTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 61 of file BookingTableGUI.php.

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

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

Member Function Documentation

◆ get()

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

Definition at line 104 of file BookingTableGUI.php.

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

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

◆ getActions()

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

Definition at line 122 of file BookingTableGUI.php.

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

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

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

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

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

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

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

84  : Generator {
85  $records = $this->provider->limitData($range, $order);
86  foreach ($records as $row) {
87  $id = $row['id'];
88  $records_row = $row_builder->buildDataRow($id, $row);
89  if (count($row['booking_participant']->getItems()) === 0) {
90  $records_row = $records_row
91  ->withDisabledAction('confirmCancelBooking')
92  ->withDisabledAction('confirmDeleteBooking')
93  ->withDisabledAction('sendMail');
94  }
95  yield $records_row;
96  }
97  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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 99 of file BookingTableGUI.php.

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

◆ render()

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

Definition at line 219 of file BookingTableGUI.php.

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

Field Documentation

◆ $ctrl

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

Definition at line 54 of file BookingTableGUI.php.

◆ $data_factory

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

Definition at line 56 of file BookingTableGUI.php.

◆ $http_request

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

Definition at line 57 of file BookingTableGUI.php.

◆ $lng

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

Definition at line 52 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 55 of file BookingTableGUI.php.

◆ $ui_renderer

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

Definition at line 58 of file BookingTableGUI.php.

◆ $user

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

Definition at line 53 of file BookingTableGUI.php.

◆ ACTION_TOKEN

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

Definition at line 41 of file BookingTableGUI.php.

◆ ACTION_TOKEN_NS

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

Definition at line 45 of file BookingTableGUI.php.

◆ ID_TOKEN

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

Definition at line 42 of file BookingTableGUI.php.

◆ ID_TOKEN_NS

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

Definition at line 47 of file BookingTableGUI.php.

◆ TABLE_NS

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

Definition at line 43 of file BookingTableGUI.php.


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