ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 

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
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
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
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)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjBookingPoolGUI::_goto (   $a_target)
static

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

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

544  {
545  global $DIC;
546 
547  $ilAccess = $DIC->access();
548  $lng = $DIC->language();
549 
550  if ($ilAccess->checkAccess("read", "", $a_target)) {
551  ilObjectGUI::_gotoRepositoryNode($a_target, "render");
552  } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
553  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
554  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
555  ilUtil::sendFailure(sprintf(
556  $lng->txt("msg_no_perm_read_item"),
558  ), true);
560  }
561  }
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)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ addExternalEditFormCustom()

ilObjBookingPoolGUI::addExternalEditFormCustom ( ilPropertyFormGUI  $a_form)

◆ addLocatorItems()

ilObjBookingPoolGUI::addLocatorItems ( )

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

References ilObjectGUI\$locator.

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

◆ 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(), 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.
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.
$ilUser
Definition: imgupload.php:18
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.
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 379 of file class.ilObjBookingPoolGUI.php.

References IL_CAL_UNIX.

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

◆ infoScreen()

ilObjBookingPoolGUI::infoScreen ( )

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

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

Referenced by executeCommand(), and infoScreenObject().

576  {
578 
579  $this->tabs_gui->setTabActive('info');
580 
581  $this->checkPermission("visible");
582 
583  $info = new ilInfoScreenGUI($this);
584 
585  $info->enablePrivateNotes();
586 
587  if ($this->checkPermissionBool("read")) {
588  $info->enableNews();
589  }
590 
591  // no news editing for files, just notifications
592  $info->enableNewsEditing(false);
593  if ($this->checkPermissionBool("write")) {
594  $news_set = new ilSetting("news");
595  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
596 
597  if ($enable_internal_rss) {
598  $info->setBlockProperty("news", "settings", true);
599  $info->setBlockProperty("news", "public_notifications_option", true);
600  }
601  }
602 
603  // forward the command
604  if ($ilCtrl->getNextClass() == "ilinfoscreengui") {
605  $ilCtrl->forwardCommand($info);
606  } else {
607  return $ilCtrl->getHTML($info);
608  }
609  }
Class ilInfoScreenGUI.
global $ilCtrl
Definition: ilias.php:18
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 568 of file class.ilObjBookingPoolGUI.php.

References infoScreen().

569  {
570  $this->ctrl->setCmd("showSummary");
571  $this->ctrl->setCmdClass("ilinfoscreengui");
572  $this->infoScreen();
573  }
+ 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(), 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  $fixed->addSubItem($rmd);
321 
322  $rmd_day = new ilNumberInputGUI($this->lng->txt("book_reminder_day"), "rmd_day");
323  $rmd_day->setRequired(true);
324  $rmd_day->setInfo($this->lng->txt("book_reminder_day_info"));
325  $rmd_day->setSize(3);
326  $rmd_day->setSuffix($this->lng->txt("book_reminder_days"));
327  $rmd_day->setValue(max($this->object->getReminderDay(), 1));
328  $rmd_day->setMinValue(1);
329  $rmd->addSubItem($rmd_day);
330 
331  // no schedule, direct booking
332  $none = new ilRadioOption($this->lng->txt("book_schedule_type_none_direct"), ilObjBookingPool::TYPE_NO_SCHEDULE);
333  $none->setInfo($this->lng->txt("book_schedule_type_none_direct_info"));
334  $type->addOption($none);
335 
336  $limit = new ilNumberInputGUI($this->lng->txt("book_overall_limit"), "limit");
337  $limit->setSize(4);
338  $limit->setMinValue(1);
339  $limit->setInfo($this->lng->txt("book_overall_limit_info"));
340  $none->addSubItem($limit);
341 
342  // no schedule, using preferences
343  $pref = new ilRadioOption($this->lng->txt("book_schedule_type_none_preference"), ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES);
344  $pref->setInfo($this->lng->txt("book_schedule_type_none_preference_info"));
345  $type->addOption($pref);
346 
347  // number of preferences
348  $pref_nr = new ilNumberInputGUI($this->lng->txt("book_nr_of_preferences"), "preference_nr");
349  $pref_nr->setSize(4);
350  $pref_nr->setMinValue(1);
351  $pref_nr->setInfo($this->lng->txt("book_nr_of_preferences_info"));
352  $pref_nr->setRequired(true);
353  $pref->addSubItem($pref_nr);
354 
355  // preference deadline
356  $pref_deadline = new ilDateTimeInputGUI($this->lng->txt("book_pref_deadline"), "pref_deadline");
357  $pref_deadline->setShowTime(true);
358  $pref_deadline->setRequired(true);
359  $pref->addSubItem($pref_deadline);
360 
361  $public = new ilCheckboxInputGUI($this->lng->txt("book_public_log"), "public");
362  $public->setInfo($this->lng->txt("book_public_log_info"));
363  $a_form->addItem($public);
364 
365  // presentation
366  $pres = new ilFormSectionHeaderGUI();
367  $pres->setTitle($this->lng->txt('obj_presentation'));
368  $a_form->addItem($pres);
369 
370  // tile image
371  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
372 
373  // additional features
374  $feat = new ilFormSectionHeaderGUI();
375  $feat->setTitle($this->lng->txt('obj_features'));
376  $a_form->addItem($feat);
377  }
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.
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 638 of file class.ilObjBookingPoolGUI.php.

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

639  {
641  $user = $this->user;
642  $ctrl = $this->ctrl;
643  $lng = $this->lng;
644 
645  $lng->loadLanguageModule("noti");
646 
647  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
648 
649  if ($lg && $access->checkAccess("read", "", $this->ref_id)) {
650  // notification
651  if (true) {
652  if (!ilNotification::hasNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId())) {
653  $lg->addHeaderIcon(
654  "not_icon",
655  ilUtil::getImagePath("notification_off.svg"),
656  $lng->txt("noti_notification_deactivated")
657  );
658 
659  $ctrl->setParameter($this, "ntf", 1);
660  $caption = "noti_activate_notification";
661  } else {
662  $lg->addHeaderIcon(
663  "not_icon",
664  ilUtil::getImagePath("notification_on.svg"),
665  $lng->txt("noti_notification_activated")
666  );
667 
668  $ctrl->setParameter($this, "ntf", 0);
669  $caption = "noti_deactivate_notification";
670  }
671 
672  $lg->addCustomCommand(
673  $ctrl->getLinkTarget($this, "saveNotification"),
674  $caption
675  );
676 
677  $ctrl->setParameter($this, "ntf", "");
678  }
679  }
680 
681  return $lg;
682  }
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 687 of file class.ilObjBookingPoolGUI.php.

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

688  {
689  $ctrl = $this->ctrl;
690  $user = $this->user;
691 
692 
693  switch ($_GET["ntf"]) {
694  case 0:
695  ilNotification::setNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId(), false);
696  break;
697 
698  case 1:
699  ilNotification::setNotification(ilNotification::TYPE_BOOK, $user->getId(), $this->object->getId(), true);
700  break;
701  }
702  $ctrl->redirect($this, "render");
703  }
$_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 526 of file class.ilObjBookingPoolGUI.php.

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

527  {
528  $this->help->setHelpId($a_id);
529 
530  $ilHelp = $this->help;
531 
532  switch ($this->object->getScheduleType()) {
533  case ilObjBookingPool::TYPE_FIX_SCHEDULE: $object_subtype = "-schedule"; break;
534  case ilObjBookingPool::TYPE_NO_SCHEDULE: $object_subtype = "-noschedule"; break;
535  case ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES: $object_subtype = "-noschedulepref"; break;
536  }
537 
538  $ilHelp->setScreenIdComponent('book');
539  $ilHelp->setScreenId('object' . $object_subtype);
540  $ilHelp->setSubScreenId($a_id);
541  }
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 612 of file class.ilObjBookingPoolGUI.php.

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

613  {
614  $tpl = $this->tpl;
616 
617  $this->tabs_gui->clearTargets();
618 
619  $user_id = $this->profile_user_id;
620 
621  $profile = new ilPublicUserProfileGUI($user_id);
622  $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
623  $tpl->setContent($ilCtrl->getHTML($profile));
624  }
global $ilCtrl
Definition: ilias.php:18
GUI class for public user profile presentation.

◆ updateCustom()

ilObjBookingPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

395  {
396  $obj_service = $this->getObjectService();
397 
398  $pref_deadline = $a_form->getItemByPostVar("pref_deadline")->getDate();
399  $pref_deadline = $pref_deadline
400  ? $pref_deadline->get(IL_CAL_UNIX)
401  : 0;
402 
403  $this->object->setOffline(!$a_form->getInput('online'));
404  $this->object->setReminderStatus($a_form->getInput('rmd'));
405  $this->object->setReminderDay($a_form->getInput('rmd_day'));
406  $this->object->setPublicLog($a_form->getInput('public'));
407  $this->object->setScheduleType($a_form->getInput('stype'));
408  $this->object->setOverallLimit($a_form->getInput('limit') ? $a_form->getInput('limit') : null);
409  $this->object->setReservationFilterPeriod(strlen($a_form->getInput('period')) ? (int) $a_form->getInput('period') : null);
410  $this->object->setPreferenceDeadline($pref_deadline);
411  $this->object->setPreferenceNumber($a_form->getInput('preference_nr'));
412 
413  // tile image
414  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
415 
417  $this->object->getId(),
418  $a_form,
420  );
421  }
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: