3 declare(strict_types=1);
38 protected \ilLanguage
$lng;
58 $this->
ctrl = $DIC->ctrl();
59 $this->
lng = $DIC->language();
60 $this->ui_fac = $DIC->ui()->factory();
61 $this->ui_ren = $DIC->ui()->renderer();
62 $this->request = $DIC->http()->request();
63 $this->query = $DIC->http()->wrapper()->query();
65 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
69 $this->profile_manager = $DIC->skills()->internal()->manager()->getProfileManager();
70 $this->requested_table_profile_user_ass_action = $this->admin_gui_request->getTableProfileUserAssignmentAction();
71 $this->requested_table_profile_user_ass_ids = $this->admin_gui_request->getTableProfileUserAssignmentIds();
80 if ($this->requested_table_profile_user_ass_action ===
"removeUsers") {
82 foreach ($this->requested_table_profile_user_ass_ids as
$id) {
83 if ($id ===
"ALL_OBJECTS") {
84 $all_assignments = $this->profile_manager->getAssignments($this->
profile->getId());
85 foreach ($all_assignments as $assignment) {
86 $items[] = $this->ui_fac->modal()->interruptiveItem()->standard(
87 (
string) $assignment->getId(),
92 $items[] = $this->ui_fac->modal()->interruptiveItem()->standard(
98 echo($this->ui_ren->renderAsync([
99 $this->ui_fac->modal()->interruptive(
101 empty($items) ? $this->
lng->txt(
"no_checkbox") : $this->
lng->txt(
"skmg_confirm_user_removal"),
102 $this->
ctrl->getFormActionByClass(
"ilskillprofilegui",
"removeUsers")
104 ->withAffectedItems($items)
105 ->withActionButtonLabel(empty($items) ? $this->
lng->txt(
"ok") : $this->
lng->txt(
"delete"))
110 $table = $this->ui_fac->table()
111 ->data($this->
lng->txt(
"skmg_assigned_users"), $columns, $data_retrieval)
116 ->withActions($actions)
117 ->withRequest($this->request);
125 "type" => $this->ui_fac->table()->column()->text($this->
lng->txt(
"type"))
126 ->withIsSortable(
false),
127 "name" => $this->ui_fac->table()->column()->text($this->
lng->txt(
"name")),
128 "object" => $this->ui_fac->table()->column()->text($this->
lng->txt(
"object"))
136 $query_params_namespace = [
"skl_profile_user_assignment_table"];
138 $url_builder_delete =
new UI\URLBuilder($this->df->uri($this->request->getUri()->__toString()));
139 list($url_builder_delete, $action_parameter_token_delete, $row_id_token_delete) =
140 $url_builder_delete->acquireParameters(
141 $query_params_namespace,
147 if ($this->tree_access_manager->hasManageProfilesPermission() && !$this->
profile->getRefId() > 0) {
148 $actions[
"delete"] = $this->ui_fac->table()->action()->multi(
149 $this->
lng->txt(
"delete"),
150 $url_builder_delete->withParameter($action_parameter_token_delete,
"removeUsers"),
161 $data_retrieval =
new class (
173 public function getRows(
175 array $visible_column_ids,
179 ?array $additional_parameters
181 $records = $this->getRecords($range, $order);
182 foreach ($records as $idx => $record) {
183 $row_id = $record[
"id"];
185 yield $row_builder->buildDataRow((
string) $row_id, $record);
189 public function getTotalRowCount(
191 ?array $additional_parameters
193 return count($this->getRecords());
196 protected function getRecords(
Data\
Range $range = null,
Data\
Order $order = null): array
198 $assignments = $this->profile_manager->getAssignments($this->
profile->getId());
202 foreach ($assignments as $assignment) {
203 $records[$i][
"id"] = $assignment->getId();
204 $records[$i][
"type"] = $assignment->getType();
205 $records[$i][
"name"] = $assignment->getName();
207 ? $assignment->getObjTitle()
214 $records = $this->orderRecords($records, $order);
218 $records = $this->limitRecords($records, $range);
225 return $data_retrieval;
241 $ass_title = $this->
lng->txt(
"not_available");
ArrayBasedRequestWrapper $query
getAssignmentTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Request wrapper for guis in skill administration.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $requested_table_profile_user_ass_ids
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
Profile SkillProfileManager $profile_manager
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _lookupTitle(int $obj_id)
Service SkillAdminGUIRequest $admin_gui_request
string $requested_table_profile_user_ass_action
Profile SkillProfile $profile
ServerRequestInterface $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Access SkillTreeAccess $tree_access_manager
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
A simple class to express a range of whole positive numbers.
__construct(Profile\SkillProfile $profile, Access\SkillTreeAccess $tree_access_manager)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...