ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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)
 Constructor.
 executeCommand ()
 main switch
 editObject ()
 edit object
 setTabs ()
 get tabs
 bookObject ()
 First step in booking process.
 confirmedBookingObject ()
 Book object - either of type or specific - for given dates.
 confirmBookingNumbers (array $a_objects_counter, $a_group_id, ilPropertyFormGUI $a_form=null)
 confirmedBookingNumbersObject ()
 processBooking ($a_object_id, $a_from=null, $a_to=null, $a_group_id=null)
 Book object for date.
 logObject ()
 List reservations.
 logDetailsObject ()
 changeStatusObject ()
 Change status of given reservations.
 applyLogFilterObject ()
 Apply filter from reservations table gui.
 resetLogFilterObject ()
 Reset filter in reservations table gui.
 _goto ($a_target)
 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
 infoScreen ()
 rsvConfirmCancelObject ()
 rsvCancelObject ()
 rsvInUseObject ()
 rsvNotInUseObject ()
 showProfileObject ()
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 renderSlots (ilBookingSchedule $schedule, array $object_ids, $title)
 buildDatesBySchedule ($week_start, array $hours, $schedule, array $object_ids, $seed, array &$dates)
 handleBookingSuccess ($a_obj_id)
 initBookingNumbersForm (array $a_objects_counter, $a_group_id)
 getLogReservationIds ()
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 initEditForm ()
 Init object edit form.
 getEditFormValues ()
 Get values for edit form.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __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
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 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.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $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

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

Constructor.

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

References ilObjectGUI\ilObjectGUI().

{
$this->type = "book";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
$this->lng->loadLanguageModule("book");
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjBookingPoolGUI::_goto (   $a_target)

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

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

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess("read", "", $a_target))
{
ilObjectGUI::_gotoRepositoryNode($a_target, "render");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

References $_GET.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "render"), "", $_GET["ref_id"]);
}
}
ilObjBookingPoolGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

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

{
$a_new_object->setOffline(true);
$a_new_object->update();
// always send a message
ilUtil::sendSuccess($this->lng->txt("book_pool_added"),true);
$this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
$this->ctrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::applyLogFilterObject ( )

Apply filter from reservations table gui.

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

References logObject(), and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $ilAccess;
$show_all = ($ilAccess->checkAccess('write', '', $this->object->getRefId()) ||
$this->object->hasPublicLog());
include_once 'Modules/BookingManager/classes/class.ilBookingReservationsTableGUI.php';
$table = new ilBookingReservationsTableGUI($this, 'log', $this->ref_id,
$this->object->getId(), $show_all,
($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE));
$table->resetOffset();
$table->writeFilterToSession();
$this->logObject();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::bookObject ( )

First step in booking process.

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

References $_GET, ilObjectGUI\$tpl, renderSlots(), and ilObjBookingPool\TYPE_FIX_SCHEDULE.

Referenced by confirmedBookingObject().

{
global $tpl;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt('book_back_to_list'), $this->ctrl->getLinkTarget($this, 'render'));
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
$obj = new ilBookingObject((int)$_GET['object_id']);
$this->lng->loadLanguageModule("dateplaner");
$this->ctrl->setParameter($this, 'object_id', $obj->getId());
if($this->object->getScheduleType() == ilObjBookingPool::TYPE_FIX_SCHEDULE)
{
include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php';
$schedule = new ilBookingSchedule($obj->getScheduleId());
$tpl->setContent($this->renderSlots($schedule, array($obj->getId()), $obj->getTitle()));
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setHeaderText($this->lng->txt("book_confirm_booking_no_schedule"));
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setCancel($this->lng->txt("cancel"), "render");
$cgui->setConfirm($this->lng->txt("confirm"), "confirmedBooking");
$cgui->addItem("object_id", $obj->getId(), $obj->getTitle());
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::buildDatesBySchedule (   $week_start,
array  $hours,
  $schedule,
array  $object_ids,
  $seed,
array &  $dates 
)
protected

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

References $ilUser, $in, ilCalendarUtil\_buildWeekDayList(), ilCalendarUserSettings\_getInstanceByUserId(), ilDatePresentation\formatDate(), ilBookingReservation\getAvailableObject(), IL_CAL_FKT_GETDATE, IL_CAL_UNIX, and ilCalendarSettings\TIME_FORMAT_12.

Referenced by renderSlots().

{
global $ilUser;
include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$map = array('mo', 'tu', 'we', 'th', 'fr', 'sa', 'su');
$definition = $schedule->getDefinition();
$has_open_slot = false;
foreach(ilCalendarUtil::_buildWeekDayList($seed,$week_start)->get() as $date)
{
$date_info = $date->get(IL_CAL_FKT_GETDATE,'','UTC');
$slots = array();
if(isset($definition[$map[$date_info['isoday']-1]]))
{
$slots = array();
foreach($definition[$map[$date_info['isoday']-1]] as $slot)
{
$slot = explode('-', $slot);
$slots[] = array('from'=>str_replace(':', '', $slot[0]),
'to'=>str_replace(':', '', $slot[1]));
}
}
$last = array_pop(array_keys($hours));
$slot_captions = array();
foreach($hours as $hour => $period)
{
$dates[$hour][0] = $period;
$period = explode("-", $period);
// #13738
if($user_settings->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_12)
{
if(stristr($period[0], "pm"))
{
$period[0] = (int)$period[0]+12;
}
else
{
$period[0] = (int)$period[0];
if($period[0] == 12)
{
$period[0] = 0;
}
}
if(sizeof($period) == 2)
{
if(stristr($period[1], "pm"))
{
$period[1] = (int)$period[1]+12;
}
else
{
$period[1] = (int)$period[1];
if($period[1] == 12)
{
$period[1] = 0;
}
}
}
}
if(sizeof($period) == 1)
{
$period_from = (int)substr($period[0], 0, 2)."00";
$period_to = (int)substr($period[0], 0, 2)."59";
}
else
{
$period_from = (int)substr($period[0], 0, 2)."00";
$period_to = (int)substr($period[1], 0, 2)."59";
}
$column = $date_info['isoday'];
if(!$week_start)
{
if($column < 7)
{
$column++;
}
else
{
$column = 1;
}
}
if(sizeof($slots))
{
$in = false;
foreach($slots as $slot)
{
$slot_from = mktime(substr($slot['from'], 0, 2), substr($slot['from'], 2, 2), 0, $date_info["mon"], $date_info["mday"], $date_info["year"]);
$slot_to = mktime(substr($slot['to'], 0, 2), substr($slot['to'], 2, 2), 0, $date_info["mon"], $date_info["mday"], $date_info["year"]);
// always single object, we can sum up
$nr_available = (array)ilBookingReservation::getAvailableObject($object_ids, $slot_from, $slot_to-1, false, true);
// check deadline
if($slot_from < (time()+$schedule->getDeadline()*60*60) || !array_sum($nr_available))
{
continue;
}
// is slot active in current hour?
if((int)$slot['from'] < $period_to && (int)$slot['to'] > $period_from)
{
$from = array_pop(explode(' ', $from));
$to = array_pop(explode(' ', $to));
// show caption (first hour) of slot
$id = $slot_from.'_'.$slot_to;
if(!in_array($id, $slot_captions))
{
$dates[$hour][$column]['captions'][$id] = $from.'-'.$to;
$dates[$hour][$column]['available'][$id] = array_sum($nr_available);
$slot_captions[] = $id;
}
$in = true;
}
}
// (any) active slot
if($in)
{
$has_open_slot = true;
$dates[$hour][$column]['in_slot'] = $in;
}
}
}
}
return $has_open_slot;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::changeStatusObject ( )

Change status of given reservations.

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

References $_POST, ilBookingReservation\changeStatus(), logObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilAccess;
$this->tabs_gui->setTabActive('log');
if(!$_POST['reservation_id'])
{
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->logObject();
}
if ($ilAccess->checkAccess('write', '', $this->object->getRefId()))
{
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
ilBookingReservation::changeStatus($_POST['reservation_id'], (int)$_POST['tstatus']);
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
return $this->ctrl->redirect($this, 'log');
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::confirmBookingNumbers ( array  $a_objects_counter,
  $a_group_id,
ilPropertyFormGUI  $a_form = null 
)

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

References ilObjectGUI\$tpl, and initBookingNumbersForm().

Referenced by confirmedBookingNumbersObject(), and confirmedBookingObject().

{
global $tpl;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt('book_back_to_list'), $this->ctrl->getLinkTarget($this, 'render'));
if(!$a_form)
{
$a_form = $this->initBookingNumbersForm($a_objects_counter, $a_group_id);
}
$tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::confirmedBookingNumbersObject ( )

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

References $_POST, ilObjectGUI\$obj_id, $success, confirmBookingNumbers(), ilBookingReservation\getAvailableObject(), handleBookingSuccess(), initBookingNumbersForm(), processBooking(), and ilUtil\sendFailure().

{
// convert post data to initial form config
$counter = array();
foreach(array_keys($_POST) as $id)
{
if(substr($id, 0, 9) == "conf_nr__")
{
$id = explode("_", substr($id, 9));
$counter[$id[0]."_".$id[1]."_".$id[2]] = $id[3];
}
}
$group_id = $_POST["grp_id"];
$form = $this->initBookingNumbersForm($counter, $group_id);
if($form->checkInput())
{
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
$success = false;
foreach($counter as $id => $all_nr)
{
$book_nr = $form->getInput("conf_nr__".$id."_".$all_nr);
$parts = explode("_", $id);
$obj_id = $parts[0];
$from = $parts[1];
$to = $parts[2]-1;
// get currently available slots
$counter = ilBookingReservation::getAvailableObject(array($obj_id), $from, $to, false, true);
$counter = $counter[$obj_id];
if($counter)
{
// we can only book what is left
$book_nr = min($book_nr, $counter);
for($loop = 0; $loop < $book_nr; $loop++)
{
$this->processBooking($obj_id, $from, $to, $group_id);
}
}
}
{
}
else
{
ilUtil::sendFailure($this->lng->txt('book_reservation_failed'), true);
$this->ctrl->redirect($this, 'render');
}
}
else
{
$form->setValuesByPost();
return $this->confirmBookingNumbers($counter, $group_id, $form);
}
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::confirmedBookingObject ( )

Book object - either of type or specific - for given dates.

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

References $_GET, $_POST, $success, bookObject(), confirmBookingNumbers(), ilBookingReservation\getAvailableObject(), ilBookingReservation\getNewGroupId(), ilBookingObject\getNrOfItemsForObjects(), handleBookingSuccess(), ilBookingReservation\isObjectAvailableNoSchedule(), processBooking(), ilUtil\sendFailure(), and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
$success = false;
if($this->object->getScheduleType() == ilObjBookingPool::TYPE_NO_SCHEDULE)
{
if($_POST['object_id'])
{
$object_id = $_POST['object_id'];
if($object_id)
{
{
$this->processBooking($object_id);
$success = $object_id;
}
else
{
// #11852
ilUtil::sendFailure($this->lng->txt('book_reservation_failed_overbooked'), true);
$this->ctrl->redirect($this, 'render');
}
}
}
}
else
{
if(!isset($_POST['date']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->bookObject();
}
// single object reservation(s)
if(isset($_GET['object_id']))
{
$confirm = array();
$object_id = (int)$_GET['object_id'];
if($object_id)
{
$group_id = null;
$nr = ilBookingObject::getNrOfItemsForObjects(array($object_id));
if($nr[$object_id] > 1 || sizeof($_POST['date']) > 1)
{
}
foreach($_POST['date'] as $date)
{
$fromto = explode('_', $date);
$fromto[1]--;
$counter = ilBookingReservation::getAvailableObject(array($object_id), $fromto[0], $fromto[1], false, true);
$counter = $counter[$object_id];
if($counter)
{
if($counter > 1)
{
$confirm[$object_id."_".$fromto[0]."_".($fromto[1]+1)] = $counter;
}
else
{
$this->processBooking($object_id, $fromto[0], $fromto[1], $group_id);
$success = $object_id;
}
}
}
}
if(sizeof($confirm))
{
return $this->confirmBookingNumbers($confirm, $group_id);
}
}
/*
// group object reservation(s)
else
{
$all_object_ids = array();
foreach(ilBookingObject::getList((int)$_GET['type_id']) as $item)
{
$all_object_ids[] = $item['booking_object_id'];
}
$possible_objects = $counter = array();
sort($_POST['date']);
foreach($_POST['date'] as $date)
{
$fromto = explode('_', $date);
$fromto[1]--;
$possible_objects[$date] = ilBookingReservation::getAvailableObject($all_object_ids, $fromto[0], $fromto[1], false);
foreach($possible_objects[$date] as $obj_id)
{
$counter[$obj_id]++;
}
}
if(max($counter))
{
// we prefer the objects which are available for most slots
arsort($counter);
$counter = array_keys($counter);
// book each slot
foreach($possible_objects as $date => $available_ids)
{
$fromto = explode('_', $date);
$fromto[1]--;
// find "best" object for slot
foreach($counter as $best_object_id)
{
if(in_array($best_object_id, $available_ids))
{
$object_id = $best_object_id;
break;
}
}
$this->processBooking($object_id, $fromto[0], $fromto[1]);
$success = true;
}
}
}
*/
}
{
}
else
{
ilUtil::sendFailure($this->lng->txt('book_reservation_failed'), true);
$this->ctrl->redirect($this, 'book');
}
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

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

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

{
// if we have no schedules yet - show info
include_once "Modules/BookingManager/classes/class.ilBookingSchedule.php";
if($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE &&
!sizeof(ilBookingSchedule::getList($this->object->getId())))
{
ilUtil::sendInfo($this->lng->txt("book_schedule_warning_edit"));
}
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::executeCommand ( )

main switch

Reimplemented from ilObjectGUI.

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

References $_GET, $cmd, $ret, ilObjectGUI\$tpl, ilObjectGUI\addHeaderAction(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), and ilObjectGUI\prepareOutput().

{
global $tpl, $ilTabs, $ilNavigationHistory;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
if(!$next_class && $cmd == 'render')
{
$this->ctrl->setCmdClass('ilBookingObjectGUI');
$next_class = $this->ctrl->getNextClass($this);
}
if(substr($cmd, 0, 4) == 'book')
{
$next_class = '';
}
$ilNavigationHistory->addItem($this->ref_id,
"./goto.php?target=book_".$this->ref_id, "book");
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
$this->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case 'ilbookingobjectgui':
$this->tabs_gui->setTabActive('render');
include_once("Modules/BookingManager/classes/class.ilBookingObjectGUI.php");
$object_gui =& new ilBookingObjectGUI($this);
$ret =& $this->ctrl->forwardCommand($object_gui);
break;
case 'ilbookingschedulegui':
$this->tabs_gui->setTabActive('schedules');
include_once("Modules/BookingManager/classes/class.ilBookingScheduleGUI.php");
$schedule_gui =& new ilBookingScheduleGUI($this);
$ret =& $this->ctrl->forwardCommand($schedule_gui);
break;
case 'ilpublicuserprofilegui':
$ilTabs->clearTargets();
include_once("Services/User/classes/class.ilPublicUserProfileGUI.php");
$profile = new ilPublicUserProfileGUI((int)$_GET["user_id"]);
$profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
$ret = $this->ctrl->forwardCommand($profile);
$tpl->setContent($ret);
break;
case 'ilinfoscreengui':
$this->infoScreen();
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
case "ilobjectcopygui":
include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
$cp = new ilObjectCopyGUI($this);
$cp->setType("book");
$this->ctrl->forwardCommand($cp);
break;
default:
$cmd = $this->ctrl->getCmd();
$cmd .= 'Object';
$this->$cmd();
break;
}
$this->addHeaderAction();
return true;
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

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

{
$a_values["online"] = !$this->object->isOffline();
$a_values["public"] = $this->object->hasPublicLog();
$a_values["stype"] = $this->object->getScheduleType();
}
ilObjBookingPoolGUI::getLogReservationIds ( )
protected

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

References $_GET, and $_POST.

Referenced by rsvConfirmCancelObject(), rsvInUseObject(), and rsvNotInUseObject().

{
if($_POST["mrsv"])
{
return $_POST["mrsv"];
}
else if((int)$_GET["reservation_id"])
{
return array((int)$_GET["reservation_id"]);
}
}

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::handleBookingSuccess (   $a_obj_id)
protected

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

References ilUtil\sendSuccess().

Referenced by confirmedBookingNumbersObject(), and confirmedBookingObject().

{
ilUtil::sendSuccess($this->lng->txt('book_reservation_confirmed'), true);
// show post booking information?
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
$obj = new ilBookingObject($a_obj_id);
$pfile = $obj->getPostFile();
$ptext = $obj->getPostText();
if(trim($ptext) || $pfile)
{
$this->ctrl->setParameterByClass('ilbookingobjectgui', 'object_id', $obj->getId());
$this->ctrl->redirectByClass('ilbookingobjectgui', 'displayPostInfo');
}
else
{
$this->ctrl->redirect($this, 'render');
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::infoScreen ( )

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

References $_GET, and $ilCtrl.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess, $ilCtrl;
$this->tabs_gui->setTabActive('info');
if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
$info->enableNews();
}
// no news editing for files, just notifications
$info->enableNewsEditing(false);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
$info->setBlockProperty("news", "settings", true);
$info->setBlockProperty("news", "public_notifications_option", true);
}
}
// forward the command
if ($ilCtrl->getNextClass() == "ilinfoscreengui")
{
$ilCtrl->forwardCommand($info);
}
else
{
return $ilCtrl->getHTML($info);
}
}

+ Here is the caller graph for this function:

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 1092 of file class.ilObjBookingPoolGUI.php.

References infoScreen().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->infoScreen();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::initBookingNumbersForm ( array  $a_objects_counter,
  $a_group_id 
)
protected

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

References $section, ilDatePresentation\formatPeriod(), and IL_CAL_UNIX.

Referenced by confirmBookingNumbers(), and confirmedBookingNumbersObject().

{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "confirmedBooking"));
$form->setTitle($this->lng->txt("book_confirm_booking_schedule_number_of_objects"));
$form->setDescription($this->lng->txt("book_confirm_booking_schedule_number_of_objects_info"));
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
$section = false;
foreach($a_objects_counter as $id => $counter)
{
$id = explode("_", $id);
$book_id = $id[0]."_".$id[1]."_".$id[2]."_".$counter;
$obj = new ilBookingObject($id[0]);
if(!$section)
{
$section->setTitle($obj->getTitle());
$form->addItem($section);
$section = true;
}
$period = /* $this->lng->txt("book_period").": ". */
new ilDateTime($id[1], IL_CAL_UNIX),
new ilDateTime($id[2], IL_CAL_UNIX));
$nr_field = new ilNumberInputGUI($period, "conf_nr__".$book_id);
$nr_field->setValue(1);
$nr_field->setSize(3);
$nr_field->setMaxValue($counter);
$nr_field->setMinValue(1);
$nr_field->setRequired(true);
$form->addItem($nr_field);
}
if($a_group_id)
{
$grp = new ilHiddenInputGUI("grp_id");
$grp->setValue($a_group_id);
$form->addItem($grp);
}
$form->addCommandButton("confirmedBookingNumbers", $this->lng->txt("confirm"));
$form->addCommandButton("render", $this->lng->txt("cancel"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

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

{
$forms = parent::initCreationForms($a_new_type);
unset($forms[self::CFORM_IMPORT]);
return $forms;
}
ilObjBookingPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

References ilPropertyFormGUI\addItem(), ilBookingObject\getList(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilObjBookingPool\TYPE_FIX_SCHEDULE, and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
$online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
$a_form->addItem($online);
$type = new ilRadioGroupInputGUI($this->lng->txt("book_schedule_type"), "stype");
$type->setRequired(true);
$a_form->addItem($type);
// #14478
include_once "Modules/BookingManager/classes/class.ilBookingObject.php";
if(sizeof(ilBookingObject::getList($this->object->getId())))
{
$type->setDisabled(true);
}
$fixed = new ilRadioOption($this->lng->txt("book_schedule_type_fixed"), ilObjBookingPool::TYPE_FIX_SCHEDULE);
$fixed->setInfo($this->lng->txt("book_schedule_type_fixed_info"));
$type->addOption($fixed);
$none = new ilRadioOption($this->lng->txt("book_schedule_type_none"), ilObjBookingPool::TYPE_NO_SCHEDULE);
$none->setInfo($this->lng->txt("book_schedule_type_none_info"));
$type->addOption($none);
$public = new ilCheckboxInputGUI($this->lng->txt("book_public_log"), "public");
$public->setInfo($this->lng->txt("book_public_log_info"));
$a_form->addItem($public);
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::logDetailsObject ( )

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

References $_GET, ilObjectGUI\$tpl, and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $tpl, $ilAccess;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "log"));
$show_all = ($ilAccess->checkAccess('write', '', $this->object->getRefId()) ||
$this->object->hasPublicLog());
$filter = null;
if($_GET["object_id"])
{
$filter["object"] = (int)$_GET["object_id"];
}
include_once 'Modules/BookingManager/classes/class.ilBookingReservationsTableGUI.php';
$table = new ilBookingReservationsTableGUI($this, 'log', $this->ref_id,
$this->object->getId(), $show_all,
($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE),
$filter, $_GET["reservation_id"]);
$tpl->setContent($table->getHTML());
}
ilObjBookingPoolGUI::logObject ( )

List reservations.

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

References $_GET, ilObjectGUI\$tpl, and ilObjBookingPool\TYPE_NO_SCHEDULE.

Referenced by applyLogFilterObject(), changeStatusObject(), resetLogFilterObject(), rsvCancelObject(), rsvInUseObject(), and rsvNotInUseObject().

{
global $tpl, $ilAccess;
$this->tabs_gui->setTabActive('log');
$show_all = ($ilAccess->checkAccess('write', '', $this->object->getRefId()) ||
$this->object->hasPublicLog());
$filter = null;
if($_GET["object_id"])
{
$filter["object"] = (int)$_GET["object_id"];
}
include_once 'Modules/BookingManager/classes/class.ilBookingReservationsTableGUI.php';
$table = new ilBookingReservationsTableGUI($this, 'log', $this->ref_id,
$this->object->getId(), $show_all,
($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE),
$filter);
$tpl->setContent($table->getHTML());
}

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::processBooking (   $a_object_id,
  $a_from = null,
  $a_to = null,
  $a_group_id = null 
)

Book object for date.

Parameters
int$a_object_id
int$a_fromtimestamp
int$a_totimestamp
int$a_group_id

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

References $ilUser, ilObjectGUI\$object, ilCalendarCategoryAssignments\addAssignment(), IL_CAL_UNIX, ilCalendarUtil\initDefaultCalendarByType(), ilCalendarEntry\setStart(), and ilCalendarCategory\TYPE_BOOK.

Referenced by confirmedBookingNumbersObject(), and confirmedBookingObject().

{
global $ilUser, $ilAccess;
// #11995
if(!$ilAccess->checkAccess('read', '', $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
};
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
$reservation = new ilBookingReservation();
$reservation->setObjectId($a_object_id);
$reservation->setUserId($ilUser->getID());
$reservation->setFrom($a_from);
$reservation->setTo($a_to);
$reservation->setGroupId($a_group_id);
$reservation->save();
if($a_from)
{
$this->lng->loadLanguageModule('dateplaner');
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
include_once 'Services/Calendar/classes/class.ilCalendarCategory.php';
$def_cat = ilCalendarUtil::initDefaultCalendarByType(ilCalendarCategory::TYPE_BOOK,$ilUser->getId(),$this->lng->txt('cal_ch_personal_book'),true);
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
$object = new ilBookingObject($a_object_id);
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
$entry = new ilCalendarEntry;
$entry->setStart(new ilDateTime($a_from, IL_CAL_UNIX));
$entry->setEnd(new ilDateTime($a_to, IL_CAL_UNIX));
$entry->setTitle($this->lng->txt('book_cal_entry').' '.$object->getTitle());
$entry->setContextId($reservation->getId());
$entry->save();
include_once 'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
$assignment = new ilCalendarCategoryAssignments($entry->getEntryId());
$assignment->addAssignment($def_cat->getCategoryId());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::renderSlots ( ilBookingSchedule  $schedule,
array  $object_ids,
  $title 
)
protected

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

References $_GET, $ilUser, ilCalendarUtil\_buildWeekDayList(), ilCalendarAppointmentColors\_getColorsByType(), ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_numericDayToString(), ilCalendarUtil\_numericMonthToString(), buildDatesBySchedule(), ilCalendarUtil\calculateFontColor(), ilBookingSchedule\getRaster(), IL_CAL_DATE, IL_CAL_FKT_GETDATE, IL_CAL_UNIX, ilCalendarSettings\TIME_FORMAT_12, ilCalendarSettings\TIME_FORMAT_24, ilDateTime\WEEK, and ilDateTime\YEAR.

Referenced by bookObject().

{
global $ilUser;
// fix
if(!$schedule->getRaster())
{
$mytpl = new ilTemplate('tpl.booking_reservation_fix.html', true, true, 'Modules/BookingManager');
$mytpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this));
$mytpl->setVariable('TXT_TITLE', $this->lng->txt('book_reservation_title'));
$mytpl->setVariable('TXT_INFO', $this->lng->txt('book_reservation_fix_info'));
$mytpl->setVariable('TXT_OBJECT', $title);
$mytpl->setVariable('TXT_CMD_BOOK', $this->lng->txt('book_confirm_booking'));
$mytpl->setVariable('TXT_CMD_CANCEL', $this->lng->txt('cancel'));
include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$morning_aggr = $user_settings->getDayStart();
$evening_aggr = $user_settings->getDayEnd();
$hours = array();
for($i = $morning_aggr;$i <= $evening_aggr;$i++)
{
switch($user_settings->getTimeFormat())
{
if ($morning_aggr > 0 && $i == $morning_aggr)
{
$hours[$i] = sprintf('%02d:00',0)."-";
}
$hours[$i].= sprintf('%02d:00',$i);
if ($evening_aggr < 23 && $i == $evening_aggr)
{
$hours[$i].= "-".sprintf('%02d:00',23);
}
break;
if ($morning_aggr > 0 && $i == $morning_aggr)
{
$hours[$i] = date('h a',mktime(0,0,0,1,1,2000))."-";
}
$hours[$i].= date('h a',mktime($i,0,0,1,1,2000));
if ($evening_aggr < 23 && $i == $evening_aggr)
{
$hours[$i].= "-".date('h a',mktime(23,0,0,1,1,2000));
}
break;
}
}
if(isset($_GET['seed']))
{
$find_first_open = false;
$seed = new ilDate($_GET['seed'], IL_CAL_DATE);
}
else
{
$find_first_open = true;
$seed = new ilDate(time(), IL_CAL_UNIX);
}
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
$week_start = $user_settings->getWeekStart();
if(!$find_first_open)
{
$dates = array();
$this->buildDatesBySchedule($week_start, $hours, $schedule, $object_ids, $seed, $dates);
}
else
{
$dates = array();
$has_open_slot = $this->buildDatesBySchedule($week_start, $hours, $schedule, $object_ids, $seed, $dates);
// find first open slot
if(!$has_open_slot)
{
// 1 year is limit for search
$limit = clone($seed);
$limit->increment(ilDate::YEAR, 1);
$limit = $limit->get(IL_CAL_UNIX);
while(!$has_open_slot && $seed->get(IL_CAL_UNIX) < $limit)
{
$seed->increment(ilDate::WEEK, 1);
$dates = array();
$has_open_slot = $this->buildDatesBySchedule($week_start, $hours, $schedule, $object_ids, $seed, $dates);
}
}
}
include_once 'Services/Calendar/classes/class.ilCalendarHeaderNavigationGUI.php';
$navigation = new ilCalendarHeaderNavigationGUI($this,$seed,ilDateTime::WEEK,'book');
$mytpl->setVariable('NAVIGATION', $navigation->getHTML());
foreach(ilCalendarUtil::_buildWeekDayList($seed,$week_start)->get() as $date)
{
$date_info = $date->get(IL_CAL_FKT_GETDATE,'','UTC');
$mytpl->setCurrentBlock('weekdays');
$mytpl->setVariable('TXT_WEEKDAY', ilCalendarUtil:: _numericDayToString($date_info['wday']));
$mytpl->setVariable('TXT_DATE', $date_info['mday'].' '.ilCalendarUtil:: _numericMonthToString($date_info['mon']));
$mytpl->parseCurrentBlock();
}
include_once 'Services/Calendar/classes/class.ilCalendarAppointmentColors.php';
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
$color = array();
for($loop = 0; $loop < 7; $loop++)
{
$col = $all[$loop];
$color[$loop+1] = 'border-bottom: 1px solid '.$col.'; background-color: '.$col.'; color: '.$fnt;
}
$counter = 0;
foreach($dates as $hour => $days)
{
$caption = $days;
$caption = array_shift($caption);
for($loop = 1; $loop < 8; $loop++)
{
if(!isset($days[$loop]))
{
$mytpl->setCurrentBlock('dates');
$mytpl->setVariable('DUMMY', '&nbsp;');
$mytpl->parseCurrentBlock();
}
else
{
if(isset($days[$loop]['captions']))
{
foreach($days[$loop]['captions'] as $slot_id => $slot_caption)
{
$mytpl->setCurrentBlock('choice');
$mytpl->setVariable('TXT_DATE', $slot_caption);
$mytpl->setVariable('VALUE_DATE', $slot_id);
$mytpl->setVariable('DATE_COLOR', $color[$loop]);
$mytpl->setVariable('TXT_AVAILABLE',
sprintf($this->lng->txt('book_reservation_available'),
$days[$loop]['available'][$slot_id]));
$mytpl->parseCurrentBlock();
}
$mytpl->setCurrentBlock('dates');
$mytpl->setVariable('DUMMY', '');
$mytpl->parseCurrentBlock();
}
else if(isset($days[$loop]['in_slot']))
{
$mytpl->setCurrentBlock('dates');
$mytpl->setVariable('DATE_COLOR', $color[$loop]);
$mytpl->parseCurrentBlock();
}
else
{
$mytpl->setCurrentBlock('dates');
$mytpl->setVariable('DUMMY', '&nbsp;');
$mytpl->parseCurrentBlock();
}
}
}
$mytpl->setCurrentBlock('slots');
$mytpl->setVariable('TXT_HOUR', $caption);
if($counter%2)
{
$mytpl->setVariable('CSS_ROW', 'tblrow1');
}
else
{
$mytpl->setVariable('CSS_ROW', 'tblrow2');
}
$mytpl->parseCurrentBlock();
$counter++;
}
}
// flexible
else
{
// :TODO: inactive for now
}
return $mytpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBookingPoolGUI::resetLogFilterObject ( )

Reset filter in reservations table gui.

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

References logObject(), and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $ilAccess;
$show_all = ($ilAccess->checkAccess('write', '', $this->object->getRefId()) ||
$this->object->hasPublicLog());
include_once 'Modules/BookingManager/classes/class.ilBookingReservationsTableGUI.php';
$table = new ilBookingReservationsTableGUI($this, 'log', $this->ref_id,
$this->object->getId(), $show_all,
($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE));
$table->resetOffset();
$table->resetFilter();
$this->logObject();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::rsvCancelObject ( )

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

References $_POST, $ilUser, logObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilBookingReservation\STATUS_CANCELLED, and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $ilAccess, $ilUser;
$ids = $_POST["rsv_id"];
if($ids)
{
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
foreach($ids as $id)
{
$obj = new ilBookingReservation($id);
if (!$ilAccess->checkAccess("write", "", $this->ref_id) && $obj->getUserId() != $ilUser->getId())
{
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->ctrl->redirect($this, 'log');
}
$obj->update();
if($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE)
{
// remove user calendar entry (#11086)
$cal_entry_id = $obj->getCalendarEntry();
if($cal_entry_id)
{
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
$entry = new ilCalendarEntry($cal_entry_id);
$entry->delete();
}
}
}
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->logObject();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::rsvConfirmCancelObject ( )

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getLogReservationIds(), ilBookingObject\getTitle(), IL_CAL_UNIX, and ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $ilCtrl, $lng, $tpl;
$ids = $this->getLogReservationIds();
if(!$ids)
{
$this->ctrl->redirect($this, 'log');
}
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "log"));
include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($ilCtrl->getFormAction($this, 'rsvCancel'));
$conf->setHeaderText($lng->txt('book_confirm_cancel'));
$conf->setConfirm($lng->txt('book_set_cancel'), 'rsvCancel');
$conf->setCancel($lng->txt('cancel'), 'log');
include_once 'Modules/BookingManager/classes/class.ilBookingObject.php';
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
foreach($ids as $id)
{
$rsv = new ilBookingReservation($id);
$obj = new ilBookingObject($rsv->getObjectId());
$details = $obj->getTitle();
if($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE)
{
$details .= ", ".ilDatePresentation::formatPeriod(
new ilDateTime($rsv->getFrom(), IL_CAL_UNIX),
new ilDateTime($rsv->getTo(), IL_CAL_UNIX));
}
$conf->addItem('rsv_id[]', $id, $details);
}
$tpl->setContent($conf->getHTML());
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::rsvInUseObject ( )

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

References getLogReservationIds(), logObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilBookingReservation\STATUS_IN_USE.

{
global $ilAccess;
if(!$ilAccess->checkAccess("write", "", $this->ref_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->ctrl->redirect($this, 'log');
}
$ids = $this->getLogReservationIds();
if($ids)
{
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
foreach($ids as $id)
{
$obj = new ilBookingReservation($id);
$obj->update();
}
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->logObject();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::rsvNotInUseObject ( )

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

References getLogReservationIds(), logObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilAccess;
if(!$ilAccess->checkAccess("write", "", $this->ref_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->ctrl->redirect($this, 'log');
}
$ids = $this->getLogReservationIds();
if($ids)
{
include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
foreach($ids as $id)
{
$obj = new ilBookingReservation($id);
$obj->setStatus(NULL);
$obj->update();
}
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->logObject();
}

+ Here is the call graph for this function:

ilObjBookingPoolGUI::setTabs ( )

get tabs

Reimplemented from ilObjectGUI.

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

References ilObjBookingPool\TYPE_NO_SCHEDULE.

{
global $ilAccess, $ilHelp;
if (in_array($this->ctrl->getCmd(), array("create", "save")) && !$this->ctrl->getNextClass())
{
return;
}
$ilHelp->setScreenIdComponent("book");
$this->tabs_gui->addTab("render",
$this->lng->txt("book_booking_types"),
$this->ctrl->getLinkTarget($this, "render"));
$this->tabs_gui->addTab("info",
$this->lng->txt("info_short"),
$this->ctrl->getLinkTarget($this, "infoscreen"));
$this->tabs_gui->addTab("log",
$this->lng->txt("book_log"),
$this->ctrl->getLinkTarget($this, "log"));
if ($ilAccess->checkAccess('write', '', $this->object->getRefId()))
{
if($this->object->getScheduleType() != ilObjBookingPool::TYPE_NO_SCHEDULE)
{
$this->tabs_gui->addTab("schedules",
$this->lng->txt("book_schedules"),
$this->ctrl->getLinkTargetByClass("ilbookingschedulegui", "render"));
}
$this->tabs_gui->addTab("settings",
$this->lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "edit"));
}
if($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId()))
{
$this->tabs_gui->addTab("perm_settings",
$this->lng->txt("perm_settings"),
$this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
}
}
ilObjBookingPoolGUI::showProfileObject ( )

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

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

{
global $tpl, $ilCtrl;
$this->tabs_gui->clearTargets();
$user_id = (int)$_GET['user_id'];
include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
$profile = new ilPublicUserProfileGUI($user_id);
$profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
$tpl->setContent($ilCtrl->getHTML($profile));
}
ilObjBookingPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

References ilPropertyFormGUI\getInput().

{
$this->object->setOffline(!$a_form->getInput('online'));
$this->object->setPublicLog($a_form->getInput('public'));
$this->object->setScheduleType($a_form->getInput('stype'));
}

+ Here is the call graph for this function:


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