ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjBookingPoolGUI Class Reference

Class ilObjBookingPoolGUI. More...

+ Inheritance diagram for ilObjBookingPoolGUI:
+ Collaboration diagram for ilObjBookingPoolGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 ilObjBookingPoolGUI constructor. More...
 
 executeCommand ()
 
 editObject ()
 
 showNoScheduleMessage ()
 Show no schedule message. More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 
 showProfileObject ()
 
 addLocatorItems ()
 
 saveNotificationObject ()
 Save notification. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 setHelpId ($a_id)
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
 $nav_history
 
 $help
 
 $user_id_to_book
 
 $user_id_assigner
 
 $service
 
 $seed
 
 $sseed
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBookingPoolGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

ilObjBookingPoolGUI constructor.

Parameters
array$a_data
int$a_id
bool$a_call_by_reference
bool$a_prepare_output
Exceptions
ilException

Definition at line 66 of file class.ilObjBookingPoolGUI.php.

References $_GET, $DIC, $user_id_assigner, ILIAS\GlobalScreen\Provider\__construct(), help(), ilBookingObject\lookupPoolId(), ilUtil\stripSlashes(), and user().

67  {
68  global $DIC;
69 
70  $this->tpl = $DIC["tpl"];
71  $this->tabs = $DIC->tabs();
72  $this->nav_history = $DIC["ilNavigationHistory"];
73  $this->ctrl = $DIC->ctrl();
74  $this->lng = $DIC->language();
75  $this->type = "book";
76  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
77  $this->lng->loadLanguageModule("book");
78 
79  // not on creation
80  if (is_object($this->object)) {
81  $this->help = new ilBookingHelpAdapter($this->object, $DIC["ilHelp"]);
82  $DIC["ilHelp"]->setScreenIdComponent("book");
83  }
84 
85  $this->user_profile_id = (int) $_GET["user_id"];
86  $this->book_obj_id = (int) $_REQUEST['object_id'];
87  $this->seed = ilUtil::stripSlashes($_GET['seed']);
88  $this->sseed = ilUtil::stripSlashes($_GET['sseed']);
89  $this->reservation_id = ilUtil::stripSlashes($_GET["reservation_id"]);
90  $this->profile_user_id = (int) $_GET['user_id'];
91 
92  $this->service = $DIC->bookingManager()->internal();
93 
94  $this->user_id_assigner = $this->user->getId();
95  if ($_GET['bkusr']) {
96  $this->user_id_to_book = (int) $_GET['bkusr'];
97  } else {
98  $this->user_id_to_book = $this->user_id_assigner; // by default user books his own booking objects.
99  }
100 
101  if ((int) $_REQUEST['object_id'] > 0 && ilBookingObject::lookupPoolId((int) $_REQUEST['object_id']) != $this->object->getId()) {
102  throw new ilException("Booking Object ID does not match Booking Pool.");
103  }
104  }
$_GET["client_id"]
Help adapter for booking manager.
user()
Definition: user.php:4
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static lookupPoolId($object_id)
Lookup pool id.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjBookingPoolGUI::_goto (   $a_target)
static

Definition at line 546 of file class.ilObjBookingPoolGUI.php.

References $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ROOT_FOLDER_ID, and ilUtil\sendFailure().

547  {
548  global $DIC;
549 
550  $ilAccess = $DIC->access();
551  $lng = $DIC->language();
552 
553  if ($ilAccess->checkAccess("read", "", $a_target)) {
554  ilObjectGUI::_gotoRepositoryNode($a_target, "render");
555  } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
556  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
557  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
558  ilUtil::sendFailure(sprintf(
559  $lng->txt("msg_no_perm_read_item"),
561  ), true);
563  }
564  }
const ROOT_FOLDER_ID
Definition: constants.php:30
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addExternalEditFormCustom()

ilObjBookingPoolGUI::addExternalEditFormCustom ( ilPropertyFormGUI  $a_form)

◆ addLocatorItems()

ilObjBookingPoolGUI::addLocatorItems ( )

Definition at line 629 of file class.ilObjBookingPoolGUI.php.

References ilObjectGUI\$locator.

630  {
631  $ilLocator = $this->locator;
632 
633  if (is_object($this->object)) {
634  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "render"), "", $this->object->getRefId());
635  }
636  }

◆ afterSave()

ilObjBookingPoolGUI::afterSave ( ilObject  $a_new_object)
protected

Definition at line 255 of file class.ilObjBookingPoolGUI.php.

References ilObject\getRefId(), and ilObject\update().

256  {
257  $a_new_object->setOffline(true);
258  $a_new_object->update();
259 
260  // always send a message
261  ilUtil::sendSuccess($this->lng->txt("book_pool_added"), true);
262  $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
263  $this->ctrl->redirect($this, "edit");
264  }
getRefId()
get reference id public
update()
update object in db
+ Here is the call graph for this function:

◆ editObject()

ilObjBookingPoolGUI::editObject ( )

Definition at line 266 of file class.ilObjBookingPoolGUI.php.

References showNoScheduleMessage().

267  {
268  $this->showNoScheduleMessage();
269  return parent::editObject();
270  }
showNoScheduleMessage()
Show no schedule message.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjBookingPoolGUI::executeCommand ( )
Returns
bool|void
Exceptions
ilCtrlException
ilObjectException

Definition at line 111 of file class.ilObjBookingPoolGUI.php.

References $ilUser, $nav_history, $ret, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilObjectGUI\addHeaderAction(), ANONYMOUS_USER_ID, ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), help(), infoScreen(), ilObjectGUI\prepareOutput(), and ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.

112  {
113  $tpl = $this->tpl;
114  $ilTabs = $this->tabs;
115  $ilNavigationHistory = $this->nav_history;
117 
118  $next_class = $this->ctrl->getNextClass($this);
119  $cmd = $this->ctrl->getCmd();
120 
121  if (!$next_class && $cmd == 'render') {
122  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
123  if ($this->object->getScheduleType() == ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES &&
124  !$this->checkPermissionBool('write')) {
125  $this->ctrl->setCmdClass('ilBookingPreferencesGUI');
126  } else {
127  $this->ctrl->setCmdClass('ilBookingObjectGUI');
128  }
129  $next_class = $this->ctrl->getNextClass($this);
130  } else {
131  $this->ctrl->redirect($this, "infoscreen");
132  }
133  }
134 
135  /* if(substr($cmd, 0, 4) == 'book')
136  {
137  $next_class = '';
138  }*/
139 
140  $ilNavigationHistory->addItem(
141  $this->ref_id,
142  "./goto.php?target=book_" . $this->ref_id,
143  "book"
144  );
145 
146  $this->prepareOutput();
147 
148  switch ($next_class) {
149  case 'ilpermissiongui':
150  $this->checkPermission('edit_permission');
151  $this->tabs_gui->setTabActive('perm_settings');
152  $perm_gui = new ilPermissionGUI($this);
153  $this->ctrl->forwardCommand($perm_gui);
154  break;
155 
156  case 'ilbookingobjectgui':
157  if (!$this->checkPermissionBool('read') && $this->checkPermissionBool('visible')) {
158  $this->ctrl->redirect($this, "infoScreen");
159  }
160  $this->checkPermission('read');
161  $this->tabs_gui->setTabActive('render');
162  $object_gui = new ilBookingObjectGUI(
163  $this,
164  $this->seed,
165  $this->sseed,
166  $this->help
167  );
168  $this->ctrl->forwardCommand($object_gui);
169  break;
170 
171  case 'ilbookingschedulegui':
172  $this->checkPermission('write');
173  $this->tabs_gui->setTabActive('schedules');
174  $schedule_gui = new ilBookingScheduleGUI($this);
175  $this->ctrl->forwardCommand($schedule_gui);
176  break;
177 
178  case 'ilpublicuserprofilegui':
179  $this->checkPermission('read');
180  $ilTabs->clearTargets();
181  $profile = new ilPublicUserProfileGUI($this->user_profile_id);
182  $profile->setBackUrl($this->ctrl->getLinkTargetByClass("ilbookingreservationsgui", ''));
183  $ret = $this->ctrl->forwardCommand($profile);
184  $tpl->setContent($ret);
185  break;
186 
187  case 'ilinfoscreengui':
188  $this->checkPermission('visible');
189  $this->infoScreen();
190  break;
191 
192  case "ilcommonactiondispatchergui":
193  $this->checkPermission('read');
195  $this->ctrl->forwardCommand($gui);
196  break;
197 
198  case "ilobjectcopygui":
199  $this->checkPermission('copy');
200  $cp = new ilObjectCopyGUI($this);
201  $cp->setType("book");
202  $this->ctrl->forwardCommand($cp);
203  break;
204 
205  case 'ilobjectmetadatagui':
206  $this->checkPermission('write');
207  $this->tabs_gui->setTabActive('meta_data');
208  $md_gui = new ilObjectMetaDataGUI($this->object, 'bobj');
209  $this->ctrl->forwardCommand($md_gui);
210  break;
211 
212  case 'ilbookingparticipantgui':
213  $this->checkPermission('write');
214  $this->tabs_gui->setTabActive('participants');
215  $object_gui = new ilBookingParticipantGUI($this);
216  $this->ctrl->forwardCommand($object_gui);
217  break;
218 
219 
220  case "ilbookingreservationsgui":
221  $this->tabs_gui->setTabActive('log');
222  $res_gui = new ilBookingReservationsGUI($this->object, $this->help);
223  $this->ctrl->forwardCommand($res_gui);
224  break;
225 
226  case 'ilbookingpreferencesgui':
227  $this->tabs_gui->setTabActive('preferences');
228  $gui = $this->service->ui()->getPreferencesGUI($this->object);
229  $this->ctrl->forwardCommand($gui);
230  break;
231 
232 
233  default:
234  if (!in_array($cmd, ["create", "save", "infoScreen"])) {
235  $this->checkPermission('read');
236  }
237  $cmd = $this->ctrl->getCmd();
238  $cmd .= 'Object';
239  $this->$cmd();
240  break;
241  }
242 
243  $this->addHeaderAction();
244  return true;
245  }
Class ilObjectMetaDataGUI.
const ANONYMOUS_USER_ID
Definition: constants.php:25
GUI class for the workflow of copying objects.
help()
Definition: help.php:2
Class ilBookingParticipantGUI.
prepareOutput($a_show_subobjects=true)
prepare output
GUI class for public user profile presentation.
Class ilBookingObjectGUI.
Class ilBookingScheduleGUI.
$ret
Definition: parser.php:6
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ilUser
Definition: imgupload.php:18
addHeaderAction()
Add header action menu.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBookingPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

Definition at line 382 of file class.ilObjBookingPoolGUI.php.

References IL_CAL_UNIX.

383  {
384  $a_values["online"] = !$this->object->isOffline();
385  $a_values["public"] = $this->object->hasPublicLog();
386  $a_values["stype"] = $this->object->getScheduleType();
387  $a_values["limit"] = $this->object->getOverallLimit();
388  $a_values["period"] = $this->object->getReservationFilterPeriod();
389  $a_values["rmd"] = $this->object->getReminderStatus();
390  $a_values["rmd_day"] = $this->object->getReminderDay();
391  $a_values["preference_nr"] = $this->object->getPreferenceNumber();
392  if ($this->object->getPreferenceDeadline() > 0) {
393  $a_values["pref_deadline"] = new ilDateTime($this->object->getPreferenceDeadline(), IL_CAL_UNIX);
394  }
395  }
const IL_CAL_UNIX

◆ infoScreen()

ilObjBookingPoolGUI::infoScreen ( )

Definition at line 578 of file class.ilObjBookingPoolGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\checkPermission(), and ilObjectGUI\checkPermissionBool().

Referenced by executeCommand(), and infoScreenObject().

579  {
580  $ilCtrl = $this->ctrl;
581 
582  $this->tabs_gui->setTabActive('info');
583 
584  $this->checkPermission("visible");
585 
586  $info = new ilInfoScreenGUI($this);
587 
588  $info->enablePrivateNotes();
589 
590  if ($this->checkPermissionBool("read")) {
591  $info->enableNews();
592  }
593 
594  // no news editing for files, just notifications
595  $info->enableNewsEditing(false);
596  if ($this->checkPermissionBool("write")) {
597  $news_set = new ilSetting("news");
598  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
599 
600  if ($enable_internal_rss) {
601  $info->setBlockProperty("news", "settings", true);
602  $info->setBlockProperty("news", "public_notifications_option", true);
603  }
604  }
605 
606  // forward the command
607  if ($ilCtrl->getNextClass() == "ilinfoscreengui") {
608  $ilCtrl->forwardCommand($info);
609  } else {
610  return $ilCtrl->getHTML($info);
611  }
612  }
Class ilInfoScreenGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjBookingPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 571 of file class.ilObjBookingPoolGUI.php.

References infoScreen().

572  {
573  $this->ctrl->setCmd("showSummary");
574  $this->ctrl->setCmdClass("ilinfoscreengui");
575  $this->infoScreen();
576  }
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjBookingPoolGUI::initCreationForms (   $a_new_type)
protected

Definition at line 247 of file class.ilObjBookingPoolGUI.php.

248  {
249  $forms = parent::initCreationForms($a_new_type);
250  unset($forms[self::CFORM_IMPORT]);
251 
252  return $forms;
253  }

◆ initEditCustomForm()

ilObjBookingPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Definition at line 288 of file class.ilObjBookingPoolGUI.php.

References $type, ilPropertyFormGUI\addItem(), ilBookingObject\getList(), ilObjectGUI\getObjectService(), ilCronManager\isJobActive(), ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilDateTimeInputGUI\setShowTime(), ilNumberInputGUI\setSize(), ilObjBookingPool\TYPE_FIX_SCHEDULE, ilObjBookingPool\TYPE_NO_SCHEDULE, and ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.

289  {
290  $obj_service = $this->getObjectService();
291 
292  $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
293  $a_form->addItem($online);
294 
295  $type = new ilRadioGroupInputGUI($this->lng->txt("book_schedule_type"), "stype");
296  $type->setRequired(true);
297  $a_form->addItem($type);
298 
299  // #14478
300  if (sizeof(ilBookingObject::getList($this->object->getId()))) {
301  $type->setDisabled(true);
302  }
303 
304  $fixed = new ilRadioOption($this->lng->txt("book_schedule_type_fixed"), ilObjBookingPool::TYPE_FIX_SCHEDULE);
305  $fixed->setInfo($this->lng->txt("book_schedule_type_fixed_info"));
306  $type->addOption($fixed);
307 
308  #23637
309  //period
310  $period = new ilNumberInputGUI($this->lng->txt("book_reservation_filter_period"), "period");
311  $period->setInfo($this->lng->txt("book_reservation_filter_period_info"));
312  $period->setSuffix($this->lng->txt("days"));
313  $period->setSize(3);
314  $period->setMinValue(0);
315  $fixed->addSubItem($period);
316 
317  // reminder
318  $rmd = new ilCheckboxInputGUI($this->lng->txt("book_reminder_setting"), "rmd");
319  $rmd->setChecked($this->object->getReminderStatus());
320  if (!ilCronManager::isJobActive('book_notification')) {
321  $rmd->setInfo($this->lng->txt("book_notification_cron_not_active"));
322  }
323  $fixed->addSubItem($rmd);
324 
325  $rmd_day = new ilNumberInputGUI($this->lng->txt("book_reminder_day"), "rmd_day");
326  $rmd_day->setRequired(true);
327  $rmd_day->setInfo($this->lng->txt("book_reminder_day_info"));
328  $rmd_day->setSize(3);
329  $rmd_day->setSuffix($this->lng->txt("book_reminder_days"));
330  $rmd_day->setValue(max($this->object->getReminderDay(), 1));
331  $rmd_day->setMinValue(1);
332  $rmd->addSubItem($rmd_day);
333 
334  // no schedule, direct booking
335  $none = new ilRadioOption($this->lng->txt("book_schedule_type_none_direct"), ilObjBookingPool::TYPE_NO_SCHEDULE);
336  $none->setInfo($this->lng->txt("book_schedule_type_none_direct_info"));
337  $type->addOption($none);
338 
339  $limit = new ilNumberInputGUI($this->lng->txt("book_overall_limit"), "limit");
340  $limit->setSize(4);
341  $limit->setMinValue(1);
342  $limit->setInfo($this->lng->txt("book_overall_limit_info"));
343  $none->addSubItem($limit);
344 
345  // no schedule, using preferences
346  $pref = new ilRadioOption($this->lng->txt("book_schedule_type_none_preference"), ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES);
347  $pref->setInfo($this->lng->txt("book_schedule_type_none_preference_info"));
348  $type->addOption($pref);
349 
350  // number of preferences
351  $pref_nr = new ilNumberInputGUI($this->lng->txt("book_nr_of_preferences"), "preference_nr");
352  $pref_nr->setSize(4);
353  $pref_nr->setMinValue(1);
354  $pref_nr->setInfo($this->lng->txt("book_nr_of_preferences_info"));
355  $pref_nr->setRequired(true);
356  $pref->addSubItem($pref_nr);
357 
358  // preference deadline
359  $pref_deadline = new ilDateTimeInputGUI($this->lng->txt("book_pref_deadline"), "pref_deadline");
360  $pref_deadline->setShowTime(true);
361  $pref_deadline->setRequired(true);
362  $pref->addSubItem($pref_deadline);
363 
364  $public = new ilCheckboxInputGUI($this->lng->txt("book_public_log"), "public");
365  $public->setInfo($this->lng->txt("book_public_log_info"));
366  $a_form->addItem($public);
367 
368  // presentation
369  $pres = new ilFormSectionHeaderGUI();
370  $pres->setTitle($this->lng->txt('obj_presentation'));
371  $a_form->addItem($pres);
372 
373  // tile image
374  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
375 
376  // additional features
377  $feat = new ilFormSectionHeaderGUI();
378  $feat->setTitle($this->lng->txt('obj_features'));
379  $a_form->addItem($feat);
380  }
This class represents an option in a radio group.
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
$type
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Info.
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
This class represents a number property in a property form.
setSize($a_size)
Set Size.
getObjectService()
Get object service.
static isJobActive($a_job_id)
Check if given job is currently active.
setRequired($a_required)
Set Required.
setShowTime($a_showtime)
Set Show Time Information.
+ Here is the call graph for this function:

◆ initHeaderAction()

ilObjBookingPoolGUI::initHeaderAction (   $a_sub_type = null,
  $a_sub_id = null 
)
protected

Definition at line 641 of file class.ilObjBookingPoolGUI.php.

References ilObjectGUI\$access, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$user, ilUtil\getImagePath(), ilNotification\hasNotification(), ilNotification\TYPE_BOOK, and ilObjBookingPool\TYPE_FIX_SCHEDULE.

642  {
644  $user = $this->user;
645  $ctrl = $this->ctrl;
646  $lng = $this->lng;
647 
648  $lng->loadLanguageModule("noti");
649 
650  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
651 
652  if ($lg && $access->checkAccess("read", "", $this->ref_id)) {
653  // notification
654  if ($this->object->getScheduleType() === ilObjBookingPool::TYPE_FIX_SCHEDULE &&
655  $this->object->getReminderStatus()) {
656  if (!ilNotification::hasNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId())) {
657  $lg->addHeaderIcon(
658  "not_icon",
659  ilUtil::getImagePath("notification_off.svg"),
660  $lng->txt("noti_notification_deactivated")
661  );
662 
663  $ctrl->setParameter($this, "ntf", 1);
664  $caption = "noti_activate_notification";
665  } else {
666  $lg->addHeaderIcon(
667  "not_icon",
668  ilUtil::getImagePath("notification_on.svg"),
669  $lng->txt("noti_notification_activated")
670  );
671 
672  $ctrl->setParameter($this, "ntf", 0);
673  $caption = "noti_deactivate_notification";
674  }
675 
676  $lg->addCustomCommand(
677  $ctrl->getLinkTarget($this, "saveNotification"),
678  $caption
679  );
680 
681  $ctrl->setParameter($this, "ntf", "");
682  }
683  }
684 
685  return $lg;
686  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ saveNotificationObject()

ilObjBookingPoolGUI::saveNotificationObject ( )

Save notification.

Definition at line 691 of file class.ilObjBookingPoolGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$user, ilNotification\setNotification(), and ilNotification\TYPE_BOOK.

692  {
693  $ctrl = $this->ctrl;
694  $user = $this->user;
695 
696 
697  switch ($_GET["ntf"]) {
698  case 0:
699  ilNotification::setNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId(), false);
700  break;
701 
702  case 1:
703  ilNotification::setNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId(), true);
704  break;
705  }
706  $ctrl->redirect($this, "render");
707  }
$_GET["client_id"]
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
+ Here is the call graph for this function:

◆ setHelpId()

ilObjBookingPoolGUI::setHelpId (   $a_id)
protected

Definition at line 529 of file class.ilObjBookingPoolGUI.php.

References $help, help(), ilObjBookingPool\TYPE_FIX_SCHEDULE, ilObjBookingPool\TYPE_NO_SCHEDULE, and ilObjBookingPool\TYPE_NO_SCHEDULE_PREFERENCES.

530  {
531  $this->help->setHelpId($a_id);
532 
533  $ilHelp = $this->help;
534 
535  switch ($this->object->getScheduleType()) {
536  case ilObjBookingPool::TYPE_FIX_SCHEDULE: $object_subtype = "-schedule"; break;
537  case ilObjBookingPool::TYPE_NO_SCHEDULE: $object_subtype = "-noschedule"; break;
538  case ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES: $object_subtype = "-noschedulepref"; break;
539  }
540 
541  $ilHelp->setScreenIdComponent('book');
542  $ilHelp->setScreenId('object' . $object_subtype);
543  $ilHelp->setSubScreenId($a_id);
544  }
help()
Definition: help.php:2
+ Here is the call graph for this function:

◆ showNoScheduleMessage()

ilObjBookingPoolGUI::showNoScheduleMessage ( )

Show no schedule message.

Parameters

Definition at line 278 of file class.ilObjBookingPoolGUI.php.

References ilBookingSchedule\getList(), ilUtil\sendInfo(), and ilObjBookingPool\TYPE_FIX_SCHEDULE.

Referenced by editObject().

279  {
280  // if we have no schedules yet - show info
281  if ($this->object->getScheduleType() == ilObjBookingPool::TYPE_FIX_SCHEDULE &&
282  !sizeof(ilBookingSchedule::getList($this->object->getId()))) {
283  ilUtil::sendInfo($this->lng->txt("book_schedule_warning_edit"));
284  }
285  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getList($a_pool_id)
Get list of booking objects for given pool.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showProfileObject()

ilObjBookingPoolGUI::showProfileObject ( )

Definition at line 615 of file class.ilObjBookingPoolGUI.php.

References ilObjectGUI\$ctrl, and ilObjectGUI\$tpl.

616  {
617  $tpl = $this->tpl;
618  $ilCtrl = $this->ctrl;
619 
620  $this->tabs_gui->clearTargets();
621 
622  $user_id = $this->profile_user_id;
623 
624  $profile = new ilPublicUserProfileGUI($user_id);
625  $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
626  $tpl->setContent($ilCtrl->getHTML($profile));
627  }
GUI class for public user profile presentation.

◆ updateCustom()

ilObjBookingPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Definition at line 397 of file class.ilObjBookingPoolGUI.php.

References ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilObjectGUI\getObjectService(), IL_CAL_UNIX, and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

398  {
399  $obj_service = $this->getObjectService();
400 
401  $pref_deadline = $a_form->getItemByPostVar("pref_deadline")->getDate();
402  $pref_deadline = $pref_deadline
403  ? $pref_deadline->get(IL_CAL_UNIX)
404  : 0;
405 
406  $this->object->setOffline(!$a_form->getInput('online'));
407  $this->object->setReminderStatus($a_form->getInput('rmd'));
408  $this->object->setReminderDay($a_form->getInput('rmd_day'));
409  $this->object->setPublicLog($a_form->getInput('public'));
410  $this->object->setScheduleType($a_form->getInput('stype'));
411  $this->object->setOverallLimit($a_form->getInput('limit') ? $a_form->getInput('limit') : null);
412  $this->object->setReservationFilterPeriod(strlen($a_form->getInput('period')) ? (int) $a_form->getInput('period') : null);
413  $this->object->setPreferenceDeadline($pref_deadline);
414  $this->object->setPreferenceNumber($a_form->getInput('preference_nr'));
415 
416  // tile image
417  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
418 
420  $this->object->getId(),
421  $a_form,
423  );
424  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
const IL_CAL_UNIX
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
getObjectService()
Get object service.
+ Here is the call graph for this function:

Field Documentation

◆ $help

ilObjBookingPoolGUI::$help
protected

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

Referenced by setHelpId().

◆ $nav_history

ilObjBookingPoolGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $seed

ilObjBookingPoolGUI::$seed
protected

Definition at line 51 of file class.ilObjBookingPoolGUI.php.

◆ $service

ilObjBookingPoolGUI::$service
protected

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

◆ $sseed

ilObjBookingPoolGUI::$sseed
protected

Definition at line 56 of file class.ilObjBookingPoolGUI.php.

◆ $tabs

ilObjBookingPoolGUI::$tabs
protected

Definition at line 21 of file class.ilObjBookingPoolGUI.php.

Referenced by executeCommand().

◆ $user_id_assigner

ilObjBookingPoolGUI::$user_id_assigner
protected

Definition at line 41 of file class.ilObjBookingPoolGUI.php.

Referenced by __construct().

◆ $user_id_to_book

ilObjBookingPoolGUI::$user_id_to_book
protected

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


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