ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBookingParticipantGUI Class Reference

Class ilBookingParticipantGUI. More...

+ Collaboration diagram for ilBookingParticipantGUI:

Public Member Functions

 __construct (ilObjBookingPoolGUI $a_parent_obj)
 Constructor. More...
 
 executeCommand ()
 main switch More...
 
 render ()
 Render list of booking participants. More...
 
 addUserFromAutoCompleteObject ()
 Add user as member. More...
 
 addParticipantObject (array $a_user_ids)
 Add new partipant. More...
 
 applyParticipantsFilter ()
 Apply filter from participants table gui. More...
 
 resetParticipantsFilter ()
 Reset filter in participants table gui. More...
 
 assignObjects ()
 

Data Fields

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

Protected Member Functions

 applyFilterAction ($a_filter_action)
 

Protected Attributes

 $tpl
 
 $tabs
 
 $ctrl
 
 $lng
 
 $access
 
 $toolbar
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBookingParticipantGUI::__construct ( ilObjBookingPoolGUI  $a_parent_obj)

Constructor.

Parameters
object$a_parent_obj

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

References $DIC.

55  {
56  global $DIC;
57 
58  $this->tpl = $DIC["tpl"];
59  $this->tabs = $DIC->tabs();
60  $this->ctrl = $DIC->ctrl();
61  $this->lng = $DIC->language();
62  $this->access = $DIC->access();
63  $this->toolbar = $DIC->toolbar();
64 
65  $this->ref_id = $a_parent_obj->ref_id;
66  $this->pool_id = $a_parent_obj->object->getId();
67 
68  $this->lng->loadLanguageModule("book");
69  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addParticipantObject()

ilBookingParticipantGUI::addParticipantObject ( array  $a_user_ids)

Add new partipant.

Parameters
array$a_user_ids
Returns
bool

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

References ilObject\_lookupType(), and ilUtil\sendFailure().

Referenced by addUserFromAutoCompleteObject().

166  {
167  foreach ($a_user_ids as $user_id) {
168  if (ilObject::_lookupType($user_id) === "usr") {
169  require_once("./Modules/BookingManager/classes/class.ilBookingParticipant.php");
170 
171  $participant_obj = new ilBookingParticipant($user_id, $this->pool_id);
172  if ($participant_obj->getIsNew()) {
173  ilUtil::sendSuccess($this->lng->txt("book_participant_assigned"), true);
174  } else {
175  ilUtil::sendFailure($this->lng->txt("book_participant_already_assigned"));
176  return false;
177  }
178  } else {
179  ilUtil::sendFailure("dummy error message, change me");
180  return false;
181  }
182  }
183 
184  $this->ctrl->redirect($this, "render");
185  return true;
186  }
Class ilBookingParticipant.
static _lookupType($a_id, $a_reference=false)
lookup object type
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:

◆ addUserFromAutoCompleteObject()

ilBookingParticipantGUI::addUserFromAutoCompleteObject ( )

Add user as member.

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

References $_POST, $user, $users, ilObjUser\_lookupId(), addParticipantObject(), render(), and ilUtil\sendFailure().

137  {
138  if (!strlen(trim($_POST['user_login']))) {
139  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
140  $this->render();
141  return false;
142  }
143 
144  $users = explode(',', $_POST['user_login']);
145 
146  $user_ids = array();
147  foreach ($users as $user) {
148  $user_id = ilObjUser::_lookupId($user);
149 
150  if (!$user_id) {
151  ilUtil::sendFailure($this->lng->txt('user_not_known'));
152  $this->render();
153  }
154  $user_ids[] = $user_id;
155  }
156 
157  return $this->addParticipantObject($user_ids);
158  }
render()
Render list of booking participants.
static _lookupId($a_user_str)
Lookup id by login.
addParticipantObject(array $a_user_ids)
Add new partipant.
$user
Definition: migrateto20.php:57
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ applyFilterAction()

ilBookingParticipantGUI::applyFilterAction (   $a_filter_action)
protected

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

References $table, and render().

Referenced by applyParticipantsFilter(), and resetParticipantsFilter().

205  {
206  include_once 'Modules/BookingManager/classes/class.ilBookingParticipantsTableGUI.php';
207  $table = new ilBookingParticipantsTableGUI($this, 'render', $this->ref_id, $this->pool_id);
208  $table->resetOffset();
209  if ($a_filter_action === self::FILTER_ACTION_RESET) {
210  $table->resetFilter();
211  } else {
212  $table->writeFilterToSession();
213  }
214 
215  $this->render();
216  }
render()
Render list of booking participants.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyParticipantsFilter()

ilBookingParticipantGUI::applyParticipantsFilter ( )

Apply filter from participants table gui.

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

References applyFilterAction().

192  {
193  $this->applyFilterAction(self::FILTER_ACTION_APPLY);
194  }
+ Here is the call graph for this function:

◆ assignObjects()

ilBookingParticipantGUI::assignObjects ( )

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

References $table.

219  {
220  $this->tabs->clearTargets();
221  $this->tabs->setBackTarget($this->lng->txt('book_back_to_list'), $this->ctrl->getLinkTarget($this, 'render'));
222 
223  include_once("./Modules/BookingManager/classes/class.ilBookingAssignObjectsTableGUI.php");
224  $table = new ilBookingAssignObjectsTableGUI($this, 'assignObjects', $this->ref_id, $this->pool_id);
225 
226  $this->tpl->setContent($table->getHTML());
227  }
List objects / booking pool assignment.
if(empty($password)) $table
Definition: pwgen.php:24

◆ executeCommand()

ilBookingParticipantGUI::executeCommand ( )

main switch

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

References $ctrl, $GLOBALS, and $ilCtrl.

75  {
77 
78  $next_class = $ilCtrl->getNextClass($this);
79 
80  switch ($next_class) {
81  case 'ilrepositorysearchgui':
82  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
83  $rep_search = new ilRepositorySearchGUI();
84  $ref_id = $this->ref_id;
85  $rep_search->addUserAccessFilterCallable(function ($a_user_id) use ($ref_id) {
86  return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
87  'render',
88  'render',
89  $this->ref_id,
90  $a_user_id
91  );
92  });
93  $rep_search->setTitle($this->lng->txt("exc_add_participant"));
94  $rep_search->setCallback($this, 'addParticipantObject');
95  $this->ctrl->setReturn($this, 'render');
96  $this->ctrl->forwardCommand($rep_search);
97  break;
98 
99  default:
100  $cmd = $ilCtrl->getCmd("render");
101  $this->$cmd();
102  break;
103  }
104  return true;
105  }
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ render()

ilBookingParticipantGUI::render ( )

Render list of booking participants.

uses ilBookingParticipantsTableGUI

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

References $table, and ilRepositorySearchGUI\fillAutoCompleteToolbar().

Referenced by addUserFromAutoCompleteObject(), and applyFilterAction().

113  {
114  if ($this->access->checkAccess('edit_permission', '', $this->ref_id)) {
116  $this,
117  $this->toolbar,
118  array(
119  'auto_complete_name' => $this->lng->txt('user'),
120  'submit_name' => $this->lng->txt('add'),
121  'add_search' => true,
122  'add_from_container' => $this->ref_id
123  )
124  );
125 
126  include_once 'Modules/BookingManager/classes/class.ilBookingParticipantsTableGUI.php';
127  $table = new ilBookingParticipantsTableGUI($this, 'render', $this->ref_id, $this->pool_id);
128 
129  $this->tpl->setContent($table->getHTML());
130  }
131  }
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetParticipantsFilter()

ilBookingParticipantGUI::resetParticipantsFilter ( )

Reset filter in participants table gui.

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

References applyFilterAction().

200  {
201  $this->applyFilterAction(self::FILTER_ACTION_RESET);
202  }
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilBookingParticipantGUI::$access
protected

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

◆ $ctrl

ilBookingParticipantGUI::$ctrl
protected

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

Referenced by executeCommand().

◆ $lng

ilBookingParticipantGUI::$lng
protected

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

◆ $tabs

ilBookingParticipantGUI::$tabs
protected

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

◆ $toolbar

ilBookingParticipantGUI::$toolbar
protected

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

◆ $tpl

ilBookingParticipantGUI::$tpl
protected

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

◆ FILTER_ACTION_APPLY

const ilBookingParticipantGUI::FILTER_ACTION_APPLY = 1

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

◆ FILTER_ACTION_RESET

const ilBookingParticipantGUI::FILTER_ACTION_RESET = 2

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

◆ PARTICIPANT_VIEW


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