ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 }
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 145 of file class.ilBookingParticipantGUI.php.

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

116 : bool
117 {
118 if (trim($this->book_request->getUserLogin()) === '') {
119 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'));
120 $this->render();
121 return false;
122 }
123
124 $users = explode(',', $this->book_request->getUserLogin());
125
126 $user_ids = array();
127 foreach ($users as $user) {
129
130 if (!$user_id) {
131 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_not_known'));
132 $this->render();
133 }
134 $user_ids[] = $user_id;
135 }
136
137 return $this->addParticipantObject($user_ids);
138 }
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 176 of file class.ilBookingParticipantGUI.php.

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

◆ applyParticipantsFilter()

ilBookingParticipantGUI::applyParticipantsFilter ( )

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

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

◆ assignObjects()

ilBookingParticipantGUI::assignObjects ( )

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

190 : void
191 {
192 $this->tabs->clearTargets();
193 $this->tabs->setBackTarget($this->lng->txt('book_back_to_list'), $this->ctrl->getLinkTarget($this, 'render'));
194
195 $table = new ilBookingAssignObjectsTableGUI($this, 'assignObjects', $this->ref_id, $this->pool_id);
196
197 $this->tpl->setContent($table->getHTML());
198 }
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 63 of file class.ilBookingParticipantGUI.php.

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->filterManageableParticipants(
75 $this->ref_id,
76 $a_user_id
77 );
78 });
79 $rep_search->setTitle($this->lng->txt("exc_add_participant"));
80 $rep_search->setCallback($this, 'addParticipantObject');
81 $this->ctrl->setReturn($this, 'render');
82 $this->ctrl->forwardCommand($rep_search);
83 break;
84
85 default:
86 $cmd = $ilCtrl->getCmd("render");
87 $this->$cmd();
88 break;
89 }
90 }
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 96 of file class.ilBookingParticipantGUI.php.

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

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

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: