ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction Class Reference
+ Inheritance diagram for ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction:
+ Collaboration diagram for ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction:

Public Member Functions

 __construct (private readonly Language $lng, private readonly \ilGlobalTemplateInterface $tpl, private readonly UIFactory $ui_factory, private readonly ParticipantRepository $participant_repository, private readonly \ilTestAccess $test_access, private readonly \ilObjTest $test_obj)
 
 getActionId ()
 
 isAvailable ()
 
 getTableAction (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
 
 getModal (URLBuilder $url_builder, array $selected_participants, bool $all_participants_selected)
 
 onSubmit (URLBuilder $url_builder, ServerRequestInterface $request, array $selected_participants, bool $all_participants_selected)
 
 allowActionForRecord (Participant $record)
 
 getSelectionErrorMessage ()
 

Data Fields

const ACTION_ID = 'delete_pax'
 

Detailed Description

Definition at line 31 of file ParticipantTableDeleteParticipantAction.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::__construct ( private readonly Language  $lng,
private readonly \ilGlobalTemplateInterface  $tpl,
private readonly UIFactory  $ui_factory,
private readonly ParticipantRepository  $participant_repository,
private readonly \ilTestAccess  $test_access,
private readonly \ilObjTest  $test_obj 
)

Definition at line 35 of file ParticipantTableDeleteParticipantAction.php.

42  {
43  }

Member Function Documentation

◆ allowActionForRecord()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::allowActionForRecord ( Participant  $record)

Implements ILIAS\Test\Participants\TableAction.

Definition at line 117 of file ParticipantTableDeleteParticipantAction.php.

References ILIAS\Test\Participants\Participant\getActiveId(), and null.

117  : bool
118  {
119  return $record->getActiveId() === null;
120  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getActionId()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::getActionId ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 45 of file ParticipantTableDeleteParticipantAction.php.

45  : string
46  {
47  return self::ACTION_ID;
48  }

◆ getModal()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::getModal ( URLBuilder  $url_builder,
array  $selected_participants,
bool  $all_participants_selected 
)
Parameters
array<Participant>$selected_participants

Implements ILIAS\Test\Participants\TableAction.

Definition at line 70 of file ParticipantTableDeleteParticipantAction.php.

References ilObjUser\_lookupFullname(), ILIAS\UI\URLBuilder\buildURI(), ILIAS\Test\Participants\Participant\getUserId(), and ILIAS\Repository\lng().

74  : ?Modal {
75  return $this->ui_factory->modal()->interruptive(
76  $this->lng->txt('confirm'),
77  $this->lng->txt('remove_selected_participants_confirmation'),
78  $url_builder->buildURI()->__toString()
79  )->withAffectedItems(
80  array_map(
81  fn(Participant $v) => $this->ui_factory->modal()->interruptiveItem()->standard(
82  (string) $v->getUserId(),
83  $this->test_obj->getAnonymity()
84  ? $this->lng->txt('anonymous')
85  : \ilObjUser::_lookupFullname($v->getUserId())
86  ),
87  $selected_participants
88  )
89  )->withActionButtonLabel($this->lng->txt('remove'));
90  }
static _lookupFullname(int $a_user_id)
+ Here is the call graph for this function:

◆ getSelectionErrorMessage()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::getSelectionErrorMessage ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 122 of file ParticipantTableDeleteParticipantAction.php.

References ILIAS\Repository\lng().

122  : ?string
123  {
124  return $this->lng->txt('delete_participants_no_valid_participants_selected');
125  }
+ Here is the call graph for this function:

◆ getTableAction()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::getTableAction ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)

Implements ILIAS\Test\Participants\TableAction.

Definition at line 55 of file ParticipantTableDeleteParticipantAction.php.

References ILIAS\Repository\lng(), ILIAS\Test\Participants\ParticipantTableActions\SHOW_ACTION, and ILIAS\UI\URLBuilder\withParameter().

60  : Action {
61  return $this->ui_factory->table()->action()->standard(
62  $this->lng->txt('remove_participants'),
63  $url_builder
64  ->withParameter($action_token, self::ACTION_ID)
65  ->withParameter($action_type_token, ParticipantTableActions::SHOW_ACTION),
66  $row_id_token
67  )->withAsync();
68  }
+ Here is the call graph for this function:

◆ isAvailable()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::isAvailable ( )

Implements ILIAS\Test\Participants\TableAction.

Definition at line 50 of file ParticipantTableDeleteParticipantAction.php.

50  : bool
51  {
52  return $this->test_access->checkManageParticipantsAccess();
53  }

◆ onSubmit()

ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::onSubmit ( URLBuilder  $url_builder,
ServerRequestInterface  $request,
array  $selected_participants,
bool  $all_participants_selected 
)
Parameters
array<Participant>$selected_participants

Implements ILIAS\Test\Participants\TableAction.

Definition at line 92 of file ParticipantTableDeleteParticipantAction.php.

References ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_FAILURE, ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_SUCCESS, and null.

97  : ?Modal {
98  if (!$this->test_access->checkManageParticipantsAccess()) {
99  $this->tpl->setOnScreenMessage(
101  $this->lng->txt('no_permission'),
102  true
103  );
104  return null;
105  }
106 
107  $this->participant_repository->removeParticipants($selected_participants);
108 
109  $this->tpl->setOnScreenMessage(
111  $this->lng->txt('tst_selected_user_data_deleted'),
112  true
113  );
114  return null;
115  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ ACTION_ID

const ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction::ACTION_ID = 'delete_pax'

Definition at line 33 of file ParticipantTableDeleteParticipantAction.php.


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