ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 get ()
 
 render ()
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

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.

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 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ get()

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

Definition at line 108 of file BookingTableGUI.php.

108 : Data
109 {
110 return $this->ui_factory
111 ->table()
112 ->data(
113 $this,
114 $this->lng->txt('cal_ch_ch'),
115 $this->getColumns(),
116 )
117 ->withId(self::class)
118 ->withActions($this->getActions())
119 ->withRequest($this->http_request);
120 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getActions()

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

Definition at line 126 of file BookingTableGUI.php.

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

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

+ Here is the call graph for this function:

◆ getColumns()

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

Definition at line 183 of file BookingTableGUI.php.

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

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

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $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.

85 : Generator {
86 $records = $this->provider->limitData($range, $order);
87 foreach ($records as $row) {
88 $id = $row['id'];
89 $records_row = $row_builder->buildDataRow($id, $row);
90 if (count($row['booking_participant']->getItems()) === 0) {
91 $records_row = $records_row
92 ->withDisabledAction('confirmCancelBooking')
93 ->withDisabledAction('confirmDeleteBooking')
94 ->withDisabledAction('sendMail');
95 }
96 yield $records_row;
97 }
98 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
buildDataRow(string $id, array $record)

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

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Calendar\ConsultationHours\BookingTableGUI::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $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 100 of file BookingTableGUI.php.

104 : ?int {
105 return count($this->provider->getData());
106 }

◆ render()

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

Definition at line 223 of file BookingTableGUI.php.

223 : string
224 {
225 return $this->ui_renderer->render(
226 [
227 $this->get()
228 ]
229 );
230 }

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: