ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilMStListCompetencesSkillsGUI.php
Go to the documentation of this file.
1<?php
2
6
15{
16 const CMD_APPLY_FILTER = 'applyFilter';
17 const CMD_INDEX = 'index';
18 const CMD_GET_ACTIONS = "getActions";
19 const CMD_RESET_FILTER = 'resetFilter';
23 protected $table;
27 protected $access;
31 private $dic;
32
33
37 public function __construct(Container $dic)
38 {
39 $this->access = ilMyStaffAccess::getInstance();
40 $this->dic = $dic;
41 }
42
43
44 protected function checkAccessOrFail() : void
45 {
46 if ($this->access->hasCurrentUserAccessToMyStaff()) {
47 return;
48 } else {
49 ilUtil::sendFailure($this->dic->language()->txt("permission_denied"), true);
50 $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
51 }
52 }
53
54
55 public function executeCommand() : void
56 {
57 $cmd = $this->dic->ctrl()->getCmd();
58 $next_class = $this->dic->ctrl()->getNextClass();
59 switch ($next_class) {
60 default:
61 switch ($cmd) {
64 case self::CMD_INDEX:
66 $this->$cmd();
67 break;
68 default:
69 $this->index();
70 break;
71 }
72 break;
73 }
74 }
75
76
77 public function index() : void
78 {
79 $this->listUsers();
80 }
81
82
83 public function listUsers() : void
84 {
85 $this->checkAccessOrFail();
86
87 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
88 $this->dic->ui()->mainTemplate()->setTitle($this->dic->language()->txt('mst_list_competences'));
89 $this->dic->ui()->mainTemplate()->setContent($this->table->getHTML());
90 }
91
92
93 public function applyFilter() : void
94 {
95 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_APPLY_FILTER, $this->dic);
96 $this->table->writeFilterToSession();
97 $this->table->resetOffset();
98 $this->index();
99 }
100
101
102 public function resetFilter() : void
103 {
104 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_RESET_FILTER, $this->dic);
105 $this->table->resetOffset();
106 $this->table->resetFilter();
107 $this->index();
108 }
109
110
114 public function getId() : string
115 {
116 $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic);
117
118 return $this->table->getId();
119 }
120
121
122 public function cancel() : void
123 {
124 $this->dic->ctrl()->redirect($this);
125 }
126
127
128 protected function getActions() : void
129 {
130 global $DIC;
131
132 $mst_co_usr_id = $DIC->http()->request()->getQueryParams()['mst_lcom_usr_id'];
133
134 if ($mst_co_usr_id > 0) {
135 $selection = new ilAdvancedSelectionListGUI();
136
137 $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl()
138 ->getLinkTarget($this, self::CMD_INDEX)));
139
140 echo $selection->getHTML(true);
141 }
142 exit;
143 }
144}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
User interface class for advanced drop-down selection lists.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:29
$DIC
Definition: xapitoken.php:46