ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBookingParticipantGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilBookingParticipantGUI:

Public Member Functions

 __construct (ilObjBookingPoolGUI $a_parent_obj)
 
 executeCommand ()
 
 render ()
 Render list of booking participants. More...
 
 addUserFromAutoCompleteObject ()
 
 addParticipantObject (array $a_user_ids)
 Add new participant. More...
 
 applyParticipantsFilter ()
 
 resetParticipantsFilter ()
 
 assignObjects ()
 

Data Fields

const FILTER_ACTION_APPLY = 1
 
const FILTER_ACTION_RESET = 2
 
const PARTICIPANT_VIEW = 1
 

Protected Member Functions

 applyFilterAction (int $a_filter_action)
 

Protected Attributes

ILIAS BookingManager StandardGUIRequest $book_request
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
int $ref_id
 
int $pool_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilBookingParticipantGUI

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om ilBookingParticipantGUI: ilRepositorySearchGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilBookingParticipantGUI::__construct ( ilObjBookingPoolGUI  $a_parent_obj)

Definition at line 40 of file class.ilBookingParticipantGUI.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObjectGUI\getObject(), ilObjectGUI\getRefId(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

42  {
43  global $DIC;
44 
45  $this->tpl = $DIC["tpl"];
46  $this->tabs = $DIC->tabs();
47  $this->ctrl = $DIC->ctrl();
48  $this->lng = $DIC->language();
49  $this->access = $DIC->access();
50  $this->toolbar = $DIC->toolbar();
51  $this->book_request = $DIC->bookingManager()
52  ->internal()
53  ->gui()
54  ->standardRequest();
55 
56 
57  $this->ref_id = $a_parent_obj->getRefId();
58  $this->pool_id = $a_parent_obj->getObject()->getId();
59 
60  $this->lng->loadLanguageModule("book");
61  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addParticipantObject()

ilBookingParticipantGUI::addParticipantObject ( array  $a_user_ids)

Add new participant.

Parameters
int[]$a_user_ids
Exceptions
ilCtrlException

Definition at line 147 of file class.ilBookingParticipantGUI.php.

References ilObject\_lookupType(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by addUserFromAutoCompleteObject().

149  : bool {
150  foreach ($a_user_ids as $user_id) {
151  if (ilObject::_lookupType($user_id) === "usr") {
152  $participant_obj = new ilBookingParticipant($user_id, $this->pool_id);
153  if ($participant_obj->getIsNew()) {
154  $this->tpl->setOnScreenMessage('success', $this->lng->txt("book_participant_assigned"), true);
155  } else {
156  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("book_participant_already_assigned"));
157  }
158  } else {
159  $this->tpl->setOnScreenMessage('failure', "dummy error message, change me");
160  return false;
161  }
162  }
163 
164  $this->ctrl->redirect($this, "render");
165  return true;
166  }
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilBookingParticipantGUI::addUserFromAutoCompleteObject ( )

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

References ilObjUser\_lookupId(), addParticipantObject(), ILIAS\Repository\lng(), and render().

118  : bool
119  {
120  if (trim($this->book_request->getUserLogin()) === '') {
121  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'));
122  $this->render();
123  return false;
124  }
125 
126  $users = explode(',', $this->book_request->getUserLogin());
127 
128  $user_ids = array();
129  foreach ($users as $user) {
130  $user_id = ilObjUser::_lookupId($user);
131 
132  if (!$user_id) {
133  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_not_known'));
134  $this->render();
135  }
136  $user_ids[] = $user_id;
137  }
138 
139  return $this->addParticipantObject($user_ids);
140  }
render()
Render list of booking participants.
static _lookupId($a_user_str)
addParticipantObject(array $a_user_ids)
Add new participant.
+ Here is the call graph for this function:

◆ applyFilterAction()

ilBookingParticipantGUI::applyFilterAction ( int  $a_filter_action)
protected

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

References render().

Referenced by applyParticipantsFilter(), and resetParticipantsFilter().

180  : void {
181  $table = new ilBookingParticipantsTableGUI($this, 'render', $this->ref_id, $this->pool_id);
182  $table->resetOffset();
183  if ($a_filter_action === self::FILTER_ACTION_RESET) {
184  $table->resetFilter();
185  } else {
186  $table->writeFilterToSession();
187  }
188 
189  $this->render();
190  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render()
Render list of booking participants.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyParticipantsFilter()

ilBookingParticipantGUI::applyParticipantsFilter ( )

Definition at line 168 of file class.ilBookingParticipantGUI.php.

References applyFilterAction().

168  : void
169  {
170  $this->applyFilterAction(self::FILTER_ACTION_APPLY);
171  }
+ Here is the call graph for this function:

◆ assignObjects()

ilBookingParticipantGUI::assignObjects ( )

Definition at line 192 of file class.ilBookingParticipantGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

192  : void
193  {
194  $this->tabs->clearTargets();
195  $this->tabs->setBackTarget($this->lng->txt('book_back_to_list'), $this->ctrl->getLinkTarget($this, 'render'));
196 
197  $table = new ilBookingAssignObjectsTableGUI($this, 'assignObjects', $this->ref_id, $this->pool_id);
198 
199  $this->tpl->setContent($table->getHTML());
200  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilBookingParticipantGUI::executeCommand ( )

Definition at line 63 of file class.ilBookingParticipantGUI.php.

References $ctrl, $ref_id, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilCtrl\getNextClass(), and ILIAS\Repository\lng().

63  : void
64  {
65  $ilCtrl = $this->ctrl;
66 
67  $next_class = $ilCtrl->getNextClass($this);
68 
69  switch ($next_class) {
70  case 'ilrepositorysearchgui':
71  $rep_search = new ilRepositorySearchGUI();
73  $rep_search->addUserAccessFilterCallable(function ($a_user_id) {
74  return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
75  'render',
76  'render',
77  $this->ref_id,
78  $a_user_id
79  );
80  });
81  $rep_search->setTitle($this->lng->txt("exc_add_participant"));
82  $rep_search->setCallback($this, 'addParticipantObject');
83  $this->ctrl->setReturn($this, 'render');
84  $this->ctrl->forwardCommand($rep_search);
85  break;
86 
87  default:
88  $cmd = $ilCtrl->getCmd("render");
89  $this->$cmd();
90  break;
91  }
92  }
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ render()

ilBookingParticipantGUI::render ( )

Render list of booking participants.

uses ilBookingParticipantsTableGUI

Definition at line 98 of file class.ilBookingParticipantGUI.php.

References $ref_id, ILIAS\Repository\access(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by addUserFromAutoCompleteObject(), and applyFilterAction().

98  : void
99  {
100  if ($this->access->checkAccess('write', '', $this->ref_id)) {
102  $this,
103  $this->toolbar,
104  array(
105  'auto_complete_name' => $this->lng->txt('user'),
106  'submit_name' => $this->lng->txt('add'),
107  'add_search' => true,
108  'add_from_container' => $this->ref_id
109  )
110  );
111 
112  $table = new ilBookingParticipantsTableGUI($this, 'render', $this->ref_id, $this->pool_id);
113 
114  $this->tpl->setContent($table->getHTML());
115  }
116  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetParticipantsFilter()

ilBookingParticipantGUI::resetParticipantsFilter ( )

Definition at line 173 of file class.ilBookingParticipantGUI.php.

References applyFilterAction().

173  : void
174  {
175  $this->applyFilterAction(self::FILTER_ACTION_RESET);
176  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilBookingParticipantGUI::$access
protected

Definition at line 35 of file class.ilBookingParticipantGUI.php.

◆ $book_request

ILIAS BookingManager StandardGUIRequest ilBookingParticipantGUI::$book_request
protected

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

◆ $ctrl

ilCtrl ilBookingParticipantGUI::$ctrl
protected

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

Referenced by executeCommand().

◆ $lng

ilLanguage ilBookingParticipantGUI::$lng
protected

Definition at line 34 of file class.ilBookingParticipantGUI.php.

◆ $pool_id

int ilBookingParticipantGUI::$pool_id
protected

Definition at line 38 of file class.ilBookingParticipantGUI.php.

◆ $ref_id

int ilBookingParticipantGUI::$ref_id
protected

Definition at line 37 of file class.ilBookingParticipantGUI.php.

Referenced by executeCommand(), and render().

◆ $tabs

ilTabsGUI ilBookingParticipantGUI::$tabs
protected

Definition at line 32 of file class.ilBookingParticipantGUI.php.

◆ $toolbar

ilToolbarGUI ilBookingParticipantGUI::$toolbar
protected

Definition at line 36 of file class.ilBookingParticipantGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilBookingParticipantGUI::$tpl
protected

Definition at line 31 of file class.ilBookingParticipantGUI.php.

◆ FILTER_ACTION_APPLY

const ilBookingParticipantGUI::FILTER_ACTION_APPLY = 1

Definition at line 26 of file class.ilBookingParticipantGUI.php.

◆ FILTER_ACTION_RESET

const ilBookingParticipantGUI::FILTER_ACTION_RESET = 2

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

◆ PARTICIPANT_VIEW

const ilBookingParticipantGUI::PARTICIPANT_VIEW = 1

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