ILIAS  trunk Revision v12.0_alpha-1613-gae4c99ebb18
ILIAS\BookingManager\Common\Table Namespace Reference

Data Structures

interface  Table
 
interface  TableAction
 @template RecordType More...
 
class  TableActions
 
interface  TableActionsFactory
 

Functions

 getTableActions ()
 
 onExecute (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
 
 showModal (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token,)
 
 submit (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token,)
 
 showErrorMessage (string $message)
 
 showSuccessMessage (string $message)
 
 getSelectionErrorMessage ()
 
 getModal (URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
 
 onSubmit (URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
 
 resolveRecords (?array $selected_ids=null)
 

Variables

trait TableActionExecutorTrait
 
trait TableActionModalTrait
 @template RecordType More...
 
const string SUBMIT_MODAL_ACTION = 'submitModalAction'
 
readonly HttpService $http
 
readonly UIRenderer $ui_renderer
 

Function Documentation

◆ getModal()

ILIAS\BookingManager\Common\Table\getModal ( URLBuilder  $url_builder,
array  $selected_records,
bool  $all_records_selected 
)
abstractprotected
Parameters
list<RecordType>$selected_records

◆ getSelectionErrorMessage()

ILIAS\BookingManager\Common\Table\getSelectionErrorMessage ( )

Definition at line 139 of file TableActionModalTrait.php.

139 : ?string
140 {
141 return $this->lng->txt('no_valid_selection');
142 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTableActions()

◆ onExecute()

ILIAS\BookingManager\Common\Table\onExecute ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)

Definition at line 43 of file TableActionModalTrait.php.

48 : ?Modal {
49 return match($this->http->resolveRowParameter($action_type_token->getName())) {
50 self::SUBMIT_MODAL_ACTION => $this->submit($url_builder, $row_id_token, $action_token, $action_type_token),
51 default => $this->showModal($url_builder, $row_id_token, $action_token, $action_type_token),
52 };
53 }
getName()
Get the full name of the token including its namespace.
This describes commonalities between the different modals.
Definition: Modal.php:35
showModal(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token,)
submit(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token,)
static http()
Fetches the global http state from ILIAS.

References ILIAS\BookingManager\Common\Table\showModal(), ILIAS\BookingManager\Common\Table\submit(), and ILIAS\BookingManager\Common\Table\SUBMIT_MODAL_ACTION.

+ Here is the call graph for this function:

◆ onSubmit()

ILIAS\BookingManager\Common\Table\onSubmit ( URLBuilder  $url_builder,
array  $selected_records,
bool  $all_records_selected 
)
abstractprotected
Parameters
list<RecordType>$selected_records

◆ resolveRecords()

ILIAS\BookingManager\Common\Table\resolveRecords ( ?array  $selected_ids = null)
abstractprotected

◆ showErrorMessage()

◆ showModal()

ILIAS\BookingManager\Common\Table\showModal ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)
protected

Definition at line 55 of file TableActionModalTrait.php.

60 : void {
61 $selected_ids = $this->http->resolveRowParameters($row_id_token->getName());
62 $all_records_selected = $selected_ids === HttpService::ALL_OBJECTS;
63
64 if ($all_records_selected) {
65 $selected_ids = null;
66 } else {
67 $selected_ids = is_string($selected_ids) ? [] : $selected_ids;
68 }
69
70 $selected_records = array_filter(
71 $this->resolveRecords($selected_ids),
72 fn(mixed $record): bool => $this->allowActionForRecord($record)
73 );
74
75 $this->http->sendAsync(
76 $this->ui_renderer->renderAsync(
77 $this->getModal(
78 $url_builder
79 ->withParameter($row_id_token, $all_records_selected ? HttpService::ALL_OBJECTS : ($selected_ids ?? []))
80 ->withParameter($action_token, $this->getActionId())
81 ->withParameter($action_type_token, self::SUBMIT_MODAL_ACTION),
82 $selected_records,
83 $all_records_selected
84 )
85 )
86 );
87 }
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
Definition: URLBuilder.php:166
resolveRecords(?array $selected_ids=null)

Referenced by ILIAS\Test\Participants\ParticipantTableActions\execute(), ILIAS\BookingManager\BookableItem\Table\Action\BookableItemTableCancelBookingAction\onExecute(), and ILIAS\BookingManager\Common\Table\onExecute().

+ Here is the caller graph for this function:

◆ showSuccessMessage()

ILIAS\BookingManager\Common\Table\showSuccessMessage ( string  $message)
protected

◆ submit()

ILIAS\BookingManager\Common\Table\submit ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)
protected

Definition at line 89 of file TableActionModalTrait.php.

94 : ?Modal {
95 $selected_ids = $this->http->resolveRowParameters($row_id_token->getName());
96 $all_records_selected = $selected_ids === HttpService::ALL_OBJECTS;
97
98 if ($all_records_selected) {
99 $selected_ids = null;
100 } else {
101 $selected_ids = is_string($selected_ids) ? [] : $selected_ids;
102 }
103
104 if (!$all_records_selected && $selected_ids === []) {
106 return null;
107 }
108
109 $selected_records = array_filter(
110 $this->resolveRecords($selected_ids),
111 fn(mixed $record): bool => $this->allowActionForRecord($record)
112 );
113
114 if ($selected_records === []) {
116 return null;
117 }
118
119 return $this->onSubmit(
120 $url_builder
121 ->withParameter($row_id_token, $all_records_selected ? HttpService::ALL_OBJECTS : $selected_ids)
122 ->withParameter($action_token, $this->getActionId())
123 ->withParameter($action_type_token, self::SUBMIT_MODAL_ACTION),
124 $selected_records,
125 $all_records_selected
126 );
127 }
onSubmit(URLBuilder $url_builder, array $selected_records, bool $all_records_selected)

Referenced by ILIAS\Test\Participants\ParticipantTableActions\execute(), ILIAS\BookingManager\BookableItem\Table\Action\BookableItemTableCancelBookingAction\onExecute(), ILIAS\BookingManager\Common\Table\onExecute(), ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI\render(), ilBookBulkCreationGUI\renderConfirmation(), ilTermDefinitionBulkCreationGUI\renderConfirmation(), and LauncherInlineTest\testLauncherInlineRendering().

+ Here is the caller graph for this function:

Variable Documentation

◆ $http

readonly HttpService ILIAS::BookingManager::Common::Table\$http
private

Definition at line 39 of file TableActionModalTrait.php.

Referenced by ilMailSearchObjectsTableGUI\__construct(), ilSessionStatisticsGUI\__construct(), ILIAS\Test\Questions\Presentation\QuestionsTableQuery\__construct(), ilOrgUnitExtension\__construct(), ILIAS\FileDelivery\Delivery\StreamDelivery\__construct(), ILIAS\Chatroom\Bans\BannedUsersTable\__construct(), ILIAS\User\Profile\Prompt\StartUpStep\__construct(), ILIAS\components\Authentication\Pages\AuthPageLanguagesOverviewTable\__construct(), ILIAS\Forum\Moderation\ForumModeratorsTable\__construct(), ILIAS\Contact\MailingLists\MailingListsMembersTable\__construct(), ILIAS\Contact\MailingLists\MailingListsTable\__construct(), ILIAS\Contact\MemberSearch\MailMemberSearchTable\__construct(), ILIAS\Search\GUI\Direct\SearchStateHandlerImpl\__construct(), ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl\__construct(), ILIAS\GlobalScreen\GUI\Access\Access\__construct(), ILIAS\GlobalScreen\GUI\Pons\__construct(), ILIAS\Test\Results\Presentation\AttemptResultsTable\__construct(), ILIAS\UI\examples\Input\Field\Image\base(), ILIAS\UI\examples\Input\Field\TreeMultiSelect\base(), ILIAS\UI\examples\Input\Field\TreeSelect\base(), ILIAS\StaticURL\Request\BundledRequestBuilder\buildRequest(), ILIAS\StaticURL\Request\LegacyRequestBuilder\buildRequest(), ILIAS\StaticURL\Request\ShortlinkRequestBuilder\buildRequest(), ILIAS\StaticURL\Request\StaticURLRequestBuilder\buildRequest(), ILIAS\UI\examples\Progress\Bar\callArtificialTaskEndpoint(), ilPropertyFormGUI\checkInput(), ilDclTableView\createOrGetStandardView(), ILIAS\WebDAV\Entrypoint\enter(), ilMailForm\getRecipientAsync(), ILIAS\FileDelivery\http(), ilMembershipNotifications\importFromForm(), ILIAS\UI\examples\Input\Field\File\in_form(), ILIAS\UI\examples\Input\Field\File\multiple(), ILIAS\StaticURL\Handler\HandlerService\performRedirect(), nusoap_client\send(), ILIAS\Repository\send(), ILIAS\Saml\Module\sendXMLString(), ILIAS\UI\examples\Progress\Bar\server(), ilRTEBaseTestCase\setMocks(), CapabilityTest\setUp(), ILIAS\Tests\FileDelivery\FileDeliveryTypes\FileDeliveryTypeFactoryTest\setUp(), ilAssQuestionPreviewGUITest\setUp(), ilMailOptionsGUITest\testMailOptionsAreAccessibleIfGlobalAccessIsNotDenied(), ilMailOptionsGUITest\testMailOptionsAreNotAccessibleIfGlobalAccessIsDeniedAndUserWillBeRedirectedToMailSystem(), ILIAS\Badge\test\TileViewTest\testShow(), and ILIAS\LegalDocuments\test\AdministrationTest\testWithDocumentAndCriterion().

◆ $ui_renderer

◆ SUBMIT_MODAL_ACTION

const string ILIAS::BookingManager::Common::Table\SUBMIT_MODAL_ACTION = 'submitModalAction'

◆ TableActionExecutorTrait

trait ILIAS::BookingManager::Common::Table\TableActionExecutorTrait
Initial value:
{
public function execute(URLBuilder $url_builder): ?Modal
{
return $this->getTableActions()->execute(...$this->acquireParameters($url_builder));
}
abstract protected function acquireParameters(URLBuilder $url_builder): array

Definition at line 26 of file TableActionExecutorTrait.php.

◆ TableActionModalTrait

trait ILIAS::BookingManager::Common::Table\TableActionModalTrait
Initial value:
{
public const string SHOW_MODAL_ACTION = 'showModalAction'

@template RecordType

Definition at line 33 of file TableActionModalTrait.php.