ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 Access AccessManager $access
 
ILIAS BookingManager StandardGUIRequest $book_request
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilCtrl $ctrl
 
ilLanguage $lng
 
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 @ilCtrl_Calls 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.

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->bookingManager()->internal()->domain()->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 $this->lng->loadLanguageModule("exc");
62 }
global $DIC
Definition: shib_login.php:26

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

+ 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 146 of file class.ilBookingParticipantGUI.php.

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

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

Referenced by addUserFromAutoCompleteObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilBookingParticipantGUI::addUserFromAutoCompleteObject ( )

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

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

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

+ Here is the call graph for this function:

◆ applyFilterAction()

ilBookingParticipantGUI::applyFilterAction ( int  $a_filter_action)
protected

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

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

◆ applyParticipantsFilter()

ilBookingParticipantGUI::applyParticipantsFilter ( )

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

167 : void
168 {
169 $this->applyFilterAction(self::FILTER_ACTION_APPLY);
170 }

◆ assignObjects()

ilBookingParticipantGUI::assignObjects ( )

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

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilBookingParticipantGUI::executeCommand ( )

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

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

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

+ Here is the call graph for this function:

◆ render()

ilBookingParticipantGUI::render ( )

Render list of booking participants.

uses ilBookingParticipantsTableGUI

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

97 : void
98 {
99 if ($this->access->canManageParticipants($this->ref_id)) {
101 $this,
102 $this->toolbar,
103 array(
104 'auto_complete_name' => $this->lng->txt('user'),
105 'submit_name' => $this->lng->txt('add'),
106 'add_search' => true,
107 'add_from_container' => $this->ref_id
108 )
109 );
110
111 $table = new ilBookingParticipantsTableGUI($this, 'render', $this->ref_id, $this->pool_id);
112
113 $this->tpl->setContent($table->getHTML());
114 }
115 }
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...

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

Referenced by addUserFromAutoCompleteObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetParticipantsFilter()

ilBookingParticipantGUI::resetParticipantsFilter ( )

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

172 : void
173 {
174 $this->applyFilterAction(self::FILTER_ACTION_RESET);
175 }

Field Documentation

◆ $access

ILIAS BookingManager Access AccessManager ilBookingParticipantGUI::$access
protected

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

◆ $book_request

ILIAS BookingManager StandardGUIRequest ilBookingParticipantGUI::$book_request
protected

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

◆ $ctrl

ilCtrl ilBookingParticipantGUI::$ctrl
protected

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

Referenced by executeCommand().

◆ $lng

ilLanguage ilBookingParticipantGUI::$lng
protected

Definition at line 35 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().

◆ $tabs

ilTabsGUI ilBookingParticipantGUI::$tabs
protected

Definition at line 33 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 32 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: