ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMStListCoursesGUI Class Reference

Class ilMStListCoursesGUI. More...

+ Collaboration diagram for ilMStListCoursesGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 index ()
 
 listUsers ()
 
 applyFilter ()
 
 resetFilter ()
 
 getId ()
 
 cancel ()
 
 getActions ()
 

Data Fields

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

Protected Member Functions

 checkAccessOrFail ()
 

Protected Attributes

 $table
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStListCoursesGUI::__construct ( )

Definition at line 30 of file class.ilMStListCoursesGUI.php.

References ilMyStaffAccess\getInstance().

31  {
32  $this->access = ilMyStaffAccess::getInstance();
33  }
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilMStListCoursesGUI::applyFilter ( )

Definition at line 115 of file class.ilMStListCoursesGUI.php.

References index().

116  {
117  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_APPLY_FILTER);
118  $this->table->writeFilterToSession();
119  $this->table->resetOffset();
120  $this->index();
121  }
Class ilMStListCoursesTableGUI.
+ Here is the call graph for this function:

◆ cancel()

ilMStListCoursesGUI::cancel ( )

Definition at line 150 of file class.ilMStListCoursesGUI.php.

References $DIC.

151  {
152  global $DIC;
153 
154  $DIC->ctrl()->redirect($this);
155  }
global $DIC
Definition: saml.php:7

◆ checkAccessOrFail()

ilMStListCoursesGUI::checkAccessOrFail ( )
protected

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

References $DIC, and ilUtil\sendFailure().

Referenced by executeCommand(), and listUsers().

40  {
41  global $DIC;
42 
43  if ($this->access->hasCurrentUserAccessToMyStaff()) {
44  return;
45  } else {
46  ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
47  $DIC->ctrl()->redirectByClass(ilPersonalDesktopGUI::class, "");
48  }
49  }
global $DIC
Definition: saml.php:7
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStListCoursesGUI::executeCommand ( )

Definition at line 55 of file class.ilMStListCoursesGUI.php.

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

56  {
57  global $DIC;
58 
59  $cmd = $DIC->ctrl()->getCmd();
60  $next_class = $DIC->ctrl()->getNextClass();
61 
62  switch ($next_class) {
63  case strtolower(ilFormPropertyDispatchGUI::class):
64  $this->checkAccessOrFail();
65 
66  $DIC->ctrl()->setReturn($this, self::CMD_INDEX);
67  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_INDEX);
68  $this->table->executeCommand();
69  break;
70  default:
71  switch ($cmd) {
72 
73  case self::CMD_RESET_FILTER:
74  case self::CMD_APPLY_FILTER:
75  case self::CMD_INDEX:
76  case self::CMD_GET_ACTIONS:
77  $this->$cmd();
78  break;
79  default:
80  $this->index();
81  break;
82  }
83  break;
84  }
85  }
global $DIC
Definition: saml.php:7
Class ilMStListCoursesTableGUI.
+ Here is the call graph for this function:

◆ getActions()

ilMStListCoursesGUI::getActions ( )

Definition at line 161 of file class.ilMStListCoursesGUI.php.

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

162  {
163  global $DIC;
164 
165  $mst_co_usr_id = $DIC->http()->request()->getQueryParams()['mst_lco_usr_id'];
166  $mst_lco_crs_ref_id = $DIC->http()->request()->getQueryParams()['mst_lco_crs_ref_id'];
167 
168  if ($mst_co_usr_id > 0 && $mst_lco_crs_ref_id > 0) {
169  $selection = new ilAdvancedSelectionListGUI();
170 
171  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
172  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT);
173  $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link);
174  };
175 
177  foreach (ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array(
178  'user_id' => $mst_co_usr_id,
179  'object_reference.deleted' => null
180  ), array( 'user_id' => '=', 'object_reference.deleted' => '!=' ))->get() as $org_unit_assignment) {
181  if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) {
182  $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu');
183  $selection->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link);
184  }
185  }
186 
187  $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl()
188  ->getLinkTarget($this, self::CMD_INDEX)));
189 
190  echo $selection->getHTML(true);
191  }
192  exit;
193  }
static _lookupTitle($a_id)
static innerjoin($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
global $DIC
Definition: saml.php:7
static _lookupObjectId($a_ref_id)
static getTextRepresentationOfOrgUnits($sort_by_title=true)
Get ref id path array.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
+ Here is the call graph for this function:

◆ getId()

ilMStListCoursesGUI::getId ( )
Returns
string

Definition at line 139 of file class.ilMStListCoursesGUI.php.

140  {
141  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_INDEX);
142 
143  return $this->table->getId();
144  }
Class ilMStListCoursesTableGUI.

◆ index()

ilMStListCoursesGUI::index ( )

Definition at line 91 of file class.ilMStListCoursesGUI.php.

References listUsers().

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

92  {
93  $this->listUsers();
94  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsers()

ilMStListCoursesGUI::listUsers ( )

Definition at line 100 of file class.ilMStListCoursesGUI.php.

References $DIC, and checkAccessOrFail().

Referenced by index().

101  {
102  global $DIC;
103 
104  $this->checkAccessOrFail();
105 
106  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_INDEX);
107  $this->table->setTitle($DIC->language()->txt('mst_list_courses'));
108  $DIC->ui()->mainTemplate()->setContent($this->table->getHTML());
109  }
global $DIC
Definition: saml.php:7
Class ilMStListCoursesTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilMStListCoursesGUI::resetFilter ( )

Definition at line 127 of file class.ilMStListCoursesGUI.php.

References index().

128  {
129  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_RESET_FILTER);
130  $this->table->resetOffset();
131  $this->table->resetFilter();
132  $this->index();
133  }
Class ilMStListCoursesTableGUI.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMStListCoursesGUI::$access
protected

Definition at line 24 of file class.ilMStListCoursesGUI.php.

◆ $table

ilMStListCoursesGUI::$table
protected

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

◆ CMD_APPLY_FILTER

const ilMStListCoursesGUI::CMD_APPLY_FILTER = 'applyFilter'

Definition at line 13 of file class.ilMStListCoursesGUI.php.

◆ CMD_GET_ACTIONS

const ilMStListCoursesGUI::CMD_GET_ACTIONS = "getActions"

Definition at line 15 of file class.ilMStListCoursesGUI.php.

Referenced by ilMStListCoursesTableGUI\fillRow().

◆ CMD_INDEX

const ilMStListCoursesGUI::CMD_INDEX = 'index'

Definition at line 14 of file class.ilMStListCoursesGUI.php.

◆ CMD_RESET_FILTER

const ilMStListCoursesGUI::CMD_RESET_FILTER = 'resetFilter'

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


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