ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMStShowUserCoursesGUI Class Reference
+ Collaboration diagram for ilMStShowUserCoursesGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 getId ()
 
 cancel ()
 
 getActions ()
 

Data Fields

const CMD_INDEX = 'index'
 
const CMD_RESET_FILTER = 'resetFilter'
 
const CMD_APPLY_FILTER = 'applyFilter'
 
const CMD_GET_ACTIONS = "getActions"
 

Protected Member Functions

 checkAccessOrFail ()
 
 index ()
 
 listUsers ()
 
 applyFilter ()
 
 resetFilter ()
 

Protected Attributes

 $usr_id
 
 $table
 
 $access
 

Detailed Description

Definition at line 16 of file class.ilMStShowUserCoursesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCoursesGUI::__construct ( )

Definition at line 39 of file class.ilMStShowUserCoursesGUI.php.

References $DIC.

40  {
41  global $DIC;
42 
43  $this->access = ilMyStaffAccess::getInstance();
44 
45  $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
46  $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
47  }
$DIC
Definition: xapitoken.php:46

Member Function Documentation

◆ applyFilter()

ilMStShowUserCoursesGUI::applyFilter ( )
protected

Definition at line 132 of file class.ilMStShowUserCoursesGUI.php.

References index().

133  {
134  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_APPLY_FILTER);
135  $this->table->writeFilterToSession();
136  $this->table->resetOffset();
137  $this->index();
138  }
+ Here is the call graph for this function:

◆ cancel()

ilMStShowUserCoursesGUI::cancel ( )

Definition at line 167 of file class.ilMStShowUserCoursesGUI.php.

References $DIC.

168  {
169  global $DIC;
170 
171  $DIC->ctrl()->redirect($this);
172  }
$DIC
Definition: xapitoken.php:46

◆ checkAccessOrFail()

ilMStShowUserCoursesGUI::checkAccessOrFail ( )
protected

Definition at line 53 of file class.ilMStShowUserCoursesGUI.php.

References $DIC, and ilUtil\sendFailure().

Referenced by executeCommand().

54  {
55  global $DIC;
56 
57  if (!$this->usr_id) {
58  ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
59  $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
60  }
61 
62  if ($this->access->hasCurrentUserAccessToMyStaff()
63  && $this->access->hasCurrentUserAccessToUser($this->usr_id)
64  ) {
65  return;
66  } else {
67  ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
68  $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
69  }
70  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStShowUserCoursesGUI::executeCommand ( )

Definition at line 76 of file class.ilMStShowUserCoursesGUI.php.

References $DIC, checkAccessOrFail(), and index().

77  {
78  global $DIC;
79 
80  $this->checkAccessOrFail();
81 
82  $cmd = $DIC->ctrl()->getCmd();
83  $next_class = $DIC->ctrl()->getNextClass();
84 
85  switch ($next_class) {
86  case strtolower(ilFormPropertyDispatchGUI::class):
87  $DIC->ctrl()->setReturn($this, self::CMD_INDEX);
88  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
89  $this->table->executeCommand();
90  break;
91  default:
92  switch ($cmd) {
93  case self::CMD_RESET_FILTER:
94  case self::CMD_APPLY_FILTER:
95  case self::CMD_INDEX:
96  case self::CMD_GET_ACTIONS:
97  $this->$cmd();
98  break;
99  default:
100  $this->index();
101  break;
102  }
103  }
104  }
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getActions()

ilMStShowUserCoursesGUI::getActions ( )

Definition at line 178 of file class.ilMStShowUserCoursesGUI.php.

References $DIC, ilLink\_getStaticLink(), ilObject2\_lookupObjectId(), ilObject2\_lookupTitle(), exit, ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits(), and ActiveRecord\innerjoin().

179  {
180  global $DIC;
181 
182  $mst_co_usr_id = $DIC->http()->request()->getQueryParams()['mst_lco_usr_id'];
183  $mst_lco_crs_ref_id = $DIC->http()->request()->getQueryParams()['mst_lco_crs_ref_id'];
184 
185  if ($mst_co_usr_id > 0 && $mst_lco_crs_ref_id > 0) {
186  $selection = new ilAdvancedSelectionListGUI();
187 
188  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
189  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT);
190  $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link);
191  };
192 
194  foreach (
195  ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array(
196  'user_id' => $mst_co_usr_id,
197  'object_reference.deleted' => null
198  ), array('user_id' => '=', 'object_reference.deleted' => '!='))->get() as $org_unit_assignment
199  ) {
200  if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) {
201  $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu');
202  $selection->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link);
203  }
204  }
205 
206  $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl()
207  ->getLinkTarget($this, self::CMD_INDEX)));
208 
209  echo $selection->getHTML(true);
210  }
211  exit;
212  }
exit
Definition: login.php:29
static _lookupTitle($a_id)
static innerjoin($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
static _lookupObjectId($a_ref_id)
static getTextRepresentationOfOrgUnits($sort_by_title=true)
Get ref id path array.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getId()

ilMStShowUserCoursesGUI::getId ( )
Returns
string

Definition at line 156 of file class.ilMStShowUserCoursesGUI.php.

157  {
158  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
159 
160  return $this->table->getId();
161  }

◆ index()

ilMStShowUserCoursesGUI::index ( )
protected

Definition at line 110 of file class.ilMStShowUserCoursesGUI.php.

References listUsers().

Referenced by applyFilter(), executeCommand(), and resetFilter().

111  {
112  $this->listUsers();
113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsers()

ilMStShowUserCoursesGUI::listUsers ( )
protected

Definition at line 119 of file class.ilMStShowUserCoursesGUI.php.

References $DIC, and ilObject\_lookupTitle().

Referenced by index().

120  {
121  global $DIC;
122 
123  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX);
124  $this->table->setTitle(sprintf($DIC->language()->txt('mst_courses_of'), ilObjCourse::_lookupTitle($this->usr_id)));
125 
126  $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
127  }
static _lookupTitle($a_id)
lookup object title
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilMStShowUserCoursesGUI::resetFilter ( )
protected

Definition at line 144 of file class.ilMStShowUserCoursesGUI.php.

References index().

145  {
146  $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_RESET_FILTER);
147  $this->table->resetOffset();
148  $this->table->resetFilter();
149  $this->index();
150  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMStShowUserCoursesGUI::$access
protected

Definition at line 33 of file class.ilMStShowUserCoursesGUI.php.

◆ $table

ilMStShowUserCoursesGUI::$table
protected

Definition at line 29 of file class.ilMStShowUserCoursesGUI.php.

◆ $usr_id

ilMStShowUserCoursesGUI::$usr_id
protected

Definition at line 25 of file class.ilMStShowUserCoursesGUI.php.

◆ CMD_APPLY_FILTER

const ilMStShowUserCoursesGUI::CMD_APPLY_FILTER = 'applyFilter'

Definition at line 20 of file class.ilMStShowUserCoursesGUI.php.

◆ CMD_GET_ACTIONS

const ilMStShowUserCoursesGUI::CMD_GET_ACTIONS = "getActions"

◆ CMD_INDEX

const ilMStShowUserCoursesGUI::CMD_INDEX = 'index'

Definition at line 18 of file class.ilMStShowUserCoursesGUI.php.

◆ CMD_RESET_FILTER

const ilMStShowUserCoursesGUI::CMD_RESET_FILTER = 'resetFilter'

Definition at line 19 of file class.ilMStShowUserCoursesGUI.php.


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