ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 33 of file class.ilMStListCoursesGUI.php.

34  {
35  $this->access = ilMyStaffAccess::getInstance();
36  }

Member Function Documentation

◆ applyFilter()

ilMStListCoursesGUI::applyFilter ( )

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

References index().

119  {
120  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_APPLY_FILTER);
121  $this->table->writeFilterToSession();
122  $this->table->resetOffset();
123  $this->index();
124  }
+ Here is the call graph for this function:

◆ cancel()

ilMStListCoursesGUI::cancel ( )

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

References $DIC.

154  {
155  global $DIC;
156 
157  $DIC->ctrl()->redirect($this);
158  }
$DIC
Definition: xapitoken.php:46

◆ checkAccessOrFail()

ilMStListCoursesGUI::checkAccessOrFail ( )
protected

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

References $DIC, and ilUtil\sendFailure().

Referenced by executeCommand(), and listUsers().

43  {
44  global $DIC;
45 
46  if ($this->access->hasCurrentUserAccessToMyStaff()) {
47  return;
48  } else {
49  ilUtil::sendFailure($DIC->language()->txt("permission_denied"), true);
50  $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
51  }
52  }
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()

ilMStListCoursesGUI::executeCommand ( )

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

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

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

◆ getActions()

ilMStListCoursesGUI::getActions ( )

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

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

165  {
166  global $DIC;
167 
168  $mst_co_usr_id = $DIC->http()->request()->getQueryParams()['mst_lco_usr_id'];
169  $mst_lco_crs_ref_id = $DIC->http()->request()->getQueryParams()['mst_lco_crs_ref_id'];
170 
171  if ($mst_co_usr_id > 0 && $mst_lco_crs_ref_id > 0) {
172  $selection = new ilAdvancedSelectionListGUI();
173 
174  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
175  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT);
176  $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link);
177  };
178 
180  foreach (ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array(
181  'user_id' => $mst_co_usr_id,
182  'object_reference.deleted' => null
183  ), array( 'user_id' => '=', 'object_reference.deleted' => '!=' ))->get() as $org_unit_assignment) {
184  if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) {
185  $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu');
186  $selection->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link);
187  }
188  }
189 
190  $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl()
191  ->getLinkTarget($this, self::CMD_INDEX)));
192 
193  echo $selection->getHTML(true);
194  }
195  exit;
196  }
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()

ilMStListCoursesGUI::getId ( )
Returns
string

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

143  {
144  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_INDEX);
145 
146  return $this->table->getId();
147  }

◆ index()

ilMStListCoursesGUI::index ( )

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

References listUsers().

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

95  {
96  $this->listUsers();
97  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsers()

ilMStListCoursesGUI::listUsers ( )

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

References $DIC, and checkAccessOrFail().

Referenced by index().

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

◆ resetFilter()

ilMStListCoursesGUI::resetFilter ( )

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

References index().

131  {
132  $this->table = new ilMStListCoursesTableGUI($this, self::CMD_RESET_FILTER);
133  $this->table->resetOffset();
134  $this->table->resetFilter();
135  $this->index();
136  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMStListCoursesGUI::$access
protected

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

◆ $table

ilMStListCoursesGUI::$table
protected

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

◆ CMD_APPLY_FILTER

const ilMStListCoursesGUI::CMD_APPLY_FILTER = 'applyFilter'

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

◆ CMD_GET_ACTIONS

const ilMStListCoursesGUI::CMD_GET_ACTIONS = "getActions"

◆ CMD_INDEX

const ilMStListCoursesGUI::CMD_INDEX = 'index'

◆ CMD_RESET_FILTER

const ilMStListCoursesGUI::CMD_RESET_FILTER = 'resetFilter'

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


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