ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilConsultationHoursGUI Class Reference

Consultation hours editor. More...

+ Collaboration diagram for ilConsultationHoursGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 getUserId ()
 Get user id.
 assignUsersToAppointments (array $users)
 Assign users to multiple appointments.
 assignUsersToAppointment (array $users, $a_app=0, $a_redirect=true)
 Assign users to an appointment.
 assignUsersToGroup (array $usr_ids)
 edit ()
 Edit multiple sequence items.
 confirmDelete ()
 confirm delete for multiple entries
 delete ()
 delete multiple entries
 showProfile ()
 show public profile of given user
 settings ()
 display settings gui
 updateSettings ()
 save settings

Data Fields

const MODE_CREATE = 1
const MODE_UPDATE = 2
const MODE_MULTI = 3

Protected Member Functions

 searchUsersForAppointments ()
 start searching for users
 sendInfoAboutUnassignedUsers ($unassigned)
 Send info message about unassigned users.
 groupList ()
 Show consultation hour group type $ilToolbar.
 addGroup (ilPropertyFormGUI $form=null)
 Show add group form type $ilToolbar type $ilTabs.
 saveGroup ()
 Save new group.
 editGroup (ilPropertyFormGUI $form=null)
 Edit group type $ilCtrl.
 updateGroup ()
 Update group type $ilCtrl type $tpl type $ilTabs.
 confirmDeleteGroup ()
 Confirm delete type $ilCtrl type $ilTabs.
 deleteGroup ()
 Delete groups.
 initGroupForm ($a_group_id=0)
 Init new/update group form.
 bookingList ()
 Show list of bookings.
 confirmDeleteBooking ()
 Show delete booking confirmation.
 confirmRejectBooking ($a_send_notification=true)
 Show delete booking confirmation.
 deleteBooking ()
 Delete booking.
 rejectBooking ($a_send_notification=true)
 appointmentList ()
 Show settings of consultation hours.
 createSequence ()
 Create new sequence.
 initFormSequence ($a_mode)
 Init form.
 saveSequence ()
 Save new sequence.
 createAppointments (ilBookingEntry $booking)
 Create calendar appointments.
 setTabs ()
 Set tabs.
 setSubTabs ()
 Set sub tabs type $ilTabs type $ilCtrl.
 updateMulti ()
 Update multiple sequence items.
 getProfileBackUrl ()
 Build context-sensitive profile back url.
 initSettingsForm ()
 build settings form

Protected Attributes

 $user_id
 $ctrl
 $booking = null

Detailed Description

Constructor & Destructor Documentation

ilConsultationHoursGUI::__construct ( )

Constructor.

Definition at line 48 of file class.ilConsultationHoursGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, $tpl, $user_id, and ilConsultationHourAppointments\getManagedUsers().

{
global $lng, $ilCtrl, $tpl, $ilUser;
$user_id = (int)$_GET['user_id'];
{
{
$this->user_id = $user_id;
}
else
{
$user_id = false;
}
}
if(!$user_id)
{
$this->user_id = $ilUser->getId();
}
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->tpl = $tpl;
}

+ Here is the call graph for this function:

Member Function Documentation

ilConsultationHoursGUI::addGroup ( ilPropertyFormGUI  $form = null)
protected

Show add group form type $ilToolbar type $ilTabs.

Definition at line 341 of file class.ilConsultationHoursGUI.php.

References $tpl, initGroupForm(), and setSubTabs().

Referenced by saveGroup().

{
global $ilTabs, $tpl;
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_grp');
if($form == null)
{
$form = $this->initGroupForm();
}
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::appointmentList ( )
protected

Show settings of consultation hours.

Todo:
add list/filter of consultation hours if user is responsible for more than one other consultation hour series.
Returns

Definition at line 639 of file class.ilConsultationHoursGUI.php.

References getUserId(), and setSubTabs().

Referenced by confirmDelete(), delete(), and edit().

{
global $ilToolbar, $ilHelp, $ilTabs;
$ilHelp->setScreenId("consultation_hours");
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
$ilToolbar->addButton($this->lng->txt('cal_ch_add_sequence'),$this->ctrl->getLinkTarget($this,'createSequence'));
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_list');
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursTableGUI.php';
$tbl = new ilConsultationHoursTableGUI($this,'appointmentList',$this->getUserId());
$tbl->parse();
$this->tpl->setContent($tbl->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::assignUsersToAppointment ( array  $users,
  $a_app = 0,
  $a_redirect = true 
)

Assign users to an appointment.

Parameters
array$usr_ids
Returns
array $unassigned_users

Definition at line 222 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $booking, $ilCtrl, ilConsultationHourUtils\bookAppointment(), ilBookingEntry\getInstanceByCalendarEntryId(), ilBookingEntry\lookupBookingsOfUser(), and sendInfoAboutUnassignedUsers().

Referenced by assignUsersToAppointments().

{
global $ilCtrl;
if($a_app)
{
$app = $a_app;
}
else
{
$app = $_REQUEST['apps'];
}
include_once './Services/Booking/classes/class.ilBookingEntry.php';
$assigned_users = array();
foreach($users as $user)
{
if($booking->getCurrentNumberOfBookings($app) >= $booking->getNumberOfBookings())
{
break;
}
if(!ilBookingEntry::lookupBookingsOfUser((array) $app, $user))
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
$assigned_users[] = $user;
}
}
$unassigned_users = array_diff($users, $assigned_users);
if($a_redirect)
{
$this->sendInfoAboutUnassignedUsers($unassigned_users);
$ilCtrl->redirect($this,'appointmentList');
}
else
{
return $unassigned_users;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::assignUsersToAppointments ( array  $users)

Assign users to multiple appointments.

Parameters
type$users

Definition at line 202 of file class.ilConsultationHoursGUI.php.

References $_SESSION, $ilCtrl, assignUsersToAppointment(), and sendInfoAboutUnassignedUsers().

{
global $ilCtrl;
$unassigned_users = array();
foreach($_SESSION['ch_apps'] as $app)
{
$unassigned_users = array_unique(array_merge($unassigned_users,$this->assignUsersToAppointment($users,$app,false)));
}
$this->sendInfoAboutUnassignedUsers($unassigned_users);
$ilCtrl->redirect($this,'appointmentList');
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::assignUsersToGroup ( array  $usr_ids)
Parameters
array$usr_ids
type$type

Definition at line 272 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $booking, $ilCtrl, ilConsultationHourUtils\bookAppointment(), ilConsultationHourAppointments\getAppointmentIdsByGroup(), ilBookingEntry\getInstanceByCalendarEntryId(), IL_CAL_DAY, IL_CAL_UNIX, ilBookingEntry\lookupBookingsOfUser(), and sendInfoAboutUnassignedUsers().

{
global $ilCtrl;
$group_id = (int) $_REQUEST['grp_id'];
$tomorrow = new ilDateTime(time(),IL_CAL_UNIX);
$tomorrow->increment(IL_CAL_DAY,1);
// Get all future consultation hours
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
include_once './Services/Booking/classes/class.ilBookingEntry.php';
$this->user_id,
$group_id,
$tomorrow
);
$users = $usr_ids;
$assigned_users = array();
foreach($apps as $app)
{
foreach($users as $user)
{
if($booking->getCurrentNumberOfBookings($app) >= $booking->getNumberOfBookings())
{
break;
}
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
$assigned_users[] = $user;
}
}
}
$this->sendInfoAboutUnassignedUsers(array_diff($users, $assigned_users));
$ilCtrl->redirect($this,'bookingList');
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::bookingList ( )
protected

Show list of bookings.

Definition at line 525 of file class.ilConsultationHoursGUI.php.

References $tpl, ilConsultationHourAppointments\getAppointmentIds(), getUserId(), and setSubTabs().

{
global $ilToolbar, $ilTabs, $tpl;
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_bookings');
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourBookingTableGUI.php';
$btable = new ilConsultationHourBookingTableGUI($this,'bookingList',$this->getUserId());
$tpl->setContent($btable->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::confirmDelete ( )

confirm delete for multiple entries

Definition at line 1125 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $tpl, appointmentList(), ilDatePresentation\formatDate(), ilBookingEntry\lookupBookingsForAppointment(), ilUtil\sendFailure(), and ilUtil\sendInfo().

{
global $tpl;
if(!isset($_REQUEST['apps']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->appointmentList();
}
include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
$this->ctrl->saveParameter($this,array('seed','app_id','dt'));
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setHeaderText($this->lng->txt('cal_delete_app_sure'));
$confirm->setCancel($this->lng->txt('cancel'),'cancel');
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
$bookings_available = array();
foreach((array) $_REQUEST['apps'] as $entry_id)
{
$entry = new ilCalendarEntry($entry_id);
$confirm->addItem('apps[]', $entry_id, ilDatePresentation::formatDate($entry->getStart()).', '.$entry->getTitle());
include_once './Services/Booking/classes/class.ilBookingEntry.php';
{
$bookings_available[] = ilDatePresentation::formatDate($entry->getStart()).', '.$entry->getTitle();
}
}
if($bookings_available)
{
ilUtil::sendInfo($this->lng->txt('cal_ch_delete_app_booking_info').'<br />'.implode('<br />',$bookings_available));
}
$confirm->setConfirm($this->lng->txt('delete'),'delete');
$confirm->setCancel($this->lng->txt('cancel'),'appointmentList');
$tpl->setContent($confirm->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::confirmDeleteBooking ( )
protected

Show delete booking confirmation.

Definition at line 541 of file class.ilConsultationHoursGUI.php.

References confirmRejectBooking().

{
$this->confirmRejectBooking(false);
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::confirmDeleteGroup ( )
protected

Confirm delete type $ilCtrl type $ilTabs.

Definition at line 433 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $GLOBALS, $ilCtrl, $tpl, and setSubTabs().

{
global $ilCtrl, $ilTabs, $tpl;
$ilCtrl->setParameter($this,'grp_id',(int) $_REQUEST['grp_id']);
$groups = array((int) $_REQUEST['grp_id']);
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_grp');
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($ilCtrl->getFormAction($this));
$confirm->setHeaderText($GLOBALS['lng']->txt('cal_ch_grp_delete_sure'));
$confirm->setConfirm($GLOBALS['lng']->txt('delete'), 'deleteGroup');
$confirm->setCancel($GLOBALS['lng']->txt('cancel'), 'groupList');
foreach($groups as $grp_id)
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$group = new ilConsultationHourGroup($grp_id);
$confirm->addItem('groups[]', $grp_id, $group->getTitle());
}
$tpl->setContent($confirm->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::confirmRejectBooking (   $a_send_notification = true)
protected

Show delete booking confirmation.

Definition at line 549 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $tpl, ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), ilUtil\sendInfo(), and setSubTabs().

Referenced by confirmDeleteBooking().

{
global $ilTabs, $tpl;
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_bookings');
include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this));
if($a_send_notification)
{
ilUtil::sendInfo($this->lng->txt('cal_ch_cancel_booking_info'));
$confirm->setHeaderText($this->lng->txt('cal_ch_cancel_booking_sure'));
$confirm->setConfirm($this->lng->txt('cal_ch_reject_booking'), 'rejectBooking');
}
else
{
ilUtil::sendInfo($this->lng->txt('cal_ch_delete_booking_info'));
$confirm->setHeaderText($this->lng->txt('cal_ch_delete_booking_sure'));
$confirm->setConfirm($this->lng->txt('cal_ch_delete_booking'), 'deleteBooking');
}
$confirm->setCancel($this->lng->txt('cancel'),'bookingList');
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
foreach((array) $_REQUEST['bookuser'] as $bookuser)
{
$ids = explode('_',$bookuser);
include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
include_once './Services/User/classes/class.ilUserUtil.php';
$entry = new ilCalendarEntry($ids[0]);
$confirm->addItem(
'bookuser[]',
$bookuser,
$ids[1],
true,
false,
'',
true,
true
).', '.ilDatePresentation::formatDate($entry->getStart())
);
}
$tpl->setContent($confirm->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::createAppointments ( ilBookingEntry  $booking)
protected

Create calendar appointments.

Parameters
ilBookingEntry$booking
Returns

Definition at line 872 of file class.ilConsultationHoursGUI.php.

References ilCalendarCategoryAssignments\addAssignment(), ilCalendarRecurrenceCalculator\calculateDateList(), ilBookingEntry\getId(), getUserId(), ilDateTime\HOUR, IL_CAL_TRANSLATION_SYSTEM, ilCalendarUtil\initDefaultCalendarByType(), ilDateTime\MINUTE, ilCalendarCategory\TYPE_CH, and ilDateList\TYPE_DATETIME.

Referenced by saveSequence().

{
include_once './Services/Calendar/classes/class.ilDateList.php';
$concurrent_dates = new ilDateList(ilDateList::TYPE_DATETIME);
$start = clone $this->form->getItemByPostVar('st')->getDate();
for($i = 0; $i < $this->form->getItemByPostVar('ap')->getValue(); $i++)
{
$concurrent_dates->add(clone $start);
$start->increment(ilDateTime::MINUTE,$this->form->getItemByPostVar('du')->getMinutes());
$start->increment(ilDateTime::HOUR,$this->form->getItemByPostVar('du')->getHours());
#$start = new ilDateTime(,IL_CAL_UNIX);
}
include_once './Services/Calendar/classes/class.ilCalendarUtil.php';
$def_cat = ilCalendarUtil::initDefaultCalendarByType(ilCalendarCategory::TYPE_CH,$this->getUserId(),$this->lng->txt('cal_ch_personal_ch'),true);
// Add calendar appointment for each
include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
include_once './Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
include_once './Services/Booking/classes/class.ilBookingPeriod.php';
foreach($concurrent_dates as $dt)
{
$end = clone $dt;
$end->increment(ilDateTime::MINUTE,$this->form->getItemByPostVar('du')->getMinutes());
$end->increment(ilDateTime::HOUR,$this->form->getItemByPostVar('du')->getHours());
new ilBookingPeriod($dt,$end),
$this->form->getItemByPostVar('frequence')->getRecurrence()
);
// Calculate with one year limit
$limit = clone $dt;
$limit->increment(ilDAteTime::YEAR,1);
$date_list = $calc->calculateDateList($dt,$limit);
foreach($date_list as $app_start)
{
$app_end = clone $app_start;
$app_end->increment(ilDateTime::MINUTE,$this->form->getItemByPostVar('du')->getMinutes());
$entry = new ilCalendarEntry();
$entry->setContextId($booking->getId());
$entry->setTitle($this->form->getInput('ti'));
$entry->setSubtitle("#consultationhour#"); // dynamic, see ilCalendarEntry
$entry->setDescription($this->form->getInput('de'));
$entry->setLocation($this->form->getInput('lo'));
$entry->setStart($app_start);
$entry->setEnd($app_end);
$entry->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$entry->save();
$cat_assign = new ilCalendarCategoryAssignments($entry->getEntryId());
$cat_assign->addAssignment($def_cat->getCategoryID());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::createSequence ( )
protected

Create new sequence.

Returns

Definition at line 661 of file class.ilConsultationHoursGUI.php.

References IL_CAL_UNIX, and initFormSequence().

{
$this->initFormSequence(self::MODE_CREATE);
$this->booking = new ilBookingEntry();
$this->form->getItemByPostVar('bo')->setValue($this->booking->getNumberOfBookings());
$this->form->getItemByPostVar('ap')->setValue(1);
$this->form->getItemByPostVar('du')->setMinutes(15);
$this->form->getItemByPostVar('st')->setDate(
new ilDateTime(mktime(8,0,0,date('n',time()),date('d',time()),date('Y',time())),IL_CAL_UNIX));
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::delete ( )

delete multiple entries

Definition at line 1174 of file class.ilConsultationHoursGUI.php.

References $_POST, $booking, $user_id, ilCalendarCategoryAssignments\_deleteByAppointmentId(), appointmentList(), ilConsultationHourUtils\cancelBooking(), ilBookingEntry\getInstanceByCalendarEntryId(), ilBookingEntry\removeObsoleteEntries(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
if(!isset($_POST['apps']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->appointmentList();
}
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
include_once 'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
foreach($_POST['apps'] as $entry_id)
{
// cancel booking for users
{
foreach($booking->getCurrentBookings($entry_id) as $user_id)
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
}
}
// remove calendar entries
include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
$entry = new ilCalendarEntry($entry_id);
$entry->delete();
}
ilUtil::sendSuccess($this->lng->txt('cal_deleted_app'), true);
$this->ctrl->redirect($this, 'appointmentList');
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::deleteBooking ( )
protected

Delete booking.

Definition at line 603 of file class.ilConsultationHoursGUI.php.

References rejectBooking().

{
$this->rejectBooking(false);
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::deleteGroup ( )
protected

Delete groups.

Definition at line 464 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $GLOBALS, $ilCtrl, and ilUtil\sendSuccess().

{
global $ilCtrl;
foreach((array) $_REQUEST['groups'] as $grp_id)
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$group = new ilConsultationHourGroup($grp_id);
$group->delete();
}
ilUtil::sendSuccess($GLOBALS['lng']->txt('cal_ch_grp_deleted'));
$ilCtrl->redirect($this,'groupList');
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::edit ( )

Edit multiple sequence items.

Definition at line 976 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $booking, ilObject\_getAllReferences(), appointmentList(), initFormSequence(), and ilUtil\sendFailure().

Referenced by updateMulti().

{
global $ilTabs;
if(!isset($_REQUEST['apps']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->appointmentList();
}
$this->initFormSequence(self::MODE_MULTI);
if($_REQUEST['apps'] && !is_array($_REQUEST['apps']))
{
$_REQUEST['apps'] = explode(';', $_REQUEST['apps']);
}
$hidden = new ilHiddenInputGUI('apps');
$hidden->setValue(implode(';', $_REQUEST['apps']));
$this->form->addItem($hidden);
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
$first = $_REQUEST['apps'];
$first = array_shift($_REQUEST['apps']);
$entry = new ilCalendarEntry($first);
$this->form->getItemByPostVar('ti')->setValue($entry->getTitle());
$this->form->getItemByPostVar('lo')->setValue($entry->getLocation());
$this->form->getItemByPostVar('de')->setValue($entry->getDescription());
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
$booking = new ilBookingEntry($entry->getContextId());
$this->form->getItemByPostVar('bo')->setValue($booking->getNumberOfBookings());
$ref_ids = array();
foreach($booking->getTargetObjIds() as $obj_id)
{
$refs = ilObject::_getAllReferences($obj_id);
$ref_ids[] = end($refs);
}
$this->form->getItemByPostVar('tgt')->setValue(implode(',',$ref_ids));
$deadline = $booking->getDeadlineHours();
$this->form->getItemByPostVar('dead')->setDays(floor($deadline/24));
$this->form->getItemByPostVar('dead')->setHours($deadline%24);
if($booking->getBookingGroup())
{
$this->form->getItemByPostVar('grp')->setValue($booking->getBookingGroup());
}
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::editGroup ( ilPropertyFormGUI  $form = null)
protected

Edit group type $ilCtrl.

Parameters
ilPropertyFormGUI$form

Definition at line 383 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $ilCtrl, $tpl, initGroupForm(), and setSubTabs().

Referenced by updateGroup().

{
global $ilCtrl, $tpl, $ilTabs;
$ilCtrl->setParameter($this,'grp_id',(int) $_REQUEST['grp_id']);
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_grp');
if($form == null)
{
$form = $this->initGroupForm((int) $_REQUEST['grp_id']);
}
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::executeCommand ( )

Execute command.

Returns

Definition at line 78 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $cmd, $ilCtrl, $ilUser, $ret, $tpl, $user_id, getProfileBackUrl(), and setTabs().

Referenced by searchUsersForAppointments().

{
global $ilUser, $ilCtrl, $tpl, $ilHelp, $ilTabs;
$ilHelp->setScreenIdComponent("cal");
switch($this->ctrl->getNextClass())
{
case "ilpublicuserprofilegui":
include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
$profile = new ilPublicUserProfileGUI($this->user_id);
$profile->setBackUrl($this->getProfileBackUrl());
$ret = $ilCtrl->forwardCommand($profile);
$tpl->setContent($ret);
break;
case 'ilrepositorysearchgui':
include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
$rep_search = new ilRepositorySearchGUI();
if(isset($_REQUEST['assignM']))
{
$rep_search->setCallback(
$this,
'assignUsersToAppointments',
array()
);
$ilCtrl->setParameter($this,'assignM',1);
$ilCtrl->setReturn($this,'appointmentList');
$ilTabs->activateSubTab('cal_ch_app_list');
}
elseif(isset($_REQUEST['grp_id']))
{
$rep_search->setCallback(
$this,
'assignUsersToGroup',
array()
);
$ilCtrl->saveParameter($this,'grp_id');
$ilCtrl->setReturn($this,'groupList');
$ilTabs->activateSubTab('cal_ch_app_grp');
}
elseif(isset($_REQUEST['apps']))
{
$rep_search->setCallback(
$this,
'assignUsersToAppointment',
array()
);
$ilCtrl->saveParameter($this,'apps');
$ilCtrl->setReturn($this,'appointmentList');
$ilTabs->activateSubTab('cal_ch_app_list');
}
$ilCtrl->forwardCommand($rep_search);
break;
default:
$tpl->setTitle($this->lng->txt("cal_ch_form_header")); // #12220
$this->setTabs();
if($ilUser->getId() != $this->user_id)
{
$ilCtrl->setParameter($this, 'user_id', $this->user_id);
}
$cmd = $this->ctrl->getCmd('appointmentList');
$this->$cmd();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::getProfileBackUrl ( )
protected

Build context-sensitive profile back url.

Returns
string

Definition at line 1232 of file class.ilConsultationHoursGUI.php.

References $_GET, and $_REQUEST.

Referenced by executeCommand(), and showProfile().

{
// from repository
if(isset($_REQUEST["ref_id"]))
{
$url = $this->ctrl->getLinkTargetByClass('ilCalendarMonthGUI');
}
// from panel
else if(isset($_GET['panel']))
{
$url = $this->ctrl->getLinkTargetByClass('ilCalendarPresentationGUI');
}
// from appointments
else
{
$url = $this->ctrl->getLinkTarget($this, 'appointmentList');
}
return $url;
}

+ Here is the caller graph for this function:

ilConsultationHoursGUI::getUserId ( )

Get user id.

Returns

Definition at line 153 of file class.ilConsultationHoursGUI.php.

References $user_id.

Referenced by appointmentList(), bookingList(), createAppointments(), groupList(), initFormSequence(), saveGroup(), saveSequence(), setSubTabs(), setTabs(), updateGroup(), and updateMulti().

{
}

+ Here is the caller graph for this function:

ilConsultationHoursGUI::groupList ( )
protected

Show consultation hour group type $ilToolbar.

Definition at line 318 of file class.ilConsultationHoursGUI.php.

References $tpl, ilConsultationHourGroups\getGroupsOfUser(), getUserId(), and setSubTabs().

{
global $ilToolbar, $ilTabs, $tpl;
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
$ilToolbar->addButton($this->lng->txt('cal_ch_add_grp'),$this->ctrl->getLinkTarget($this,'addGroup'));
$this->setSubTabs();
$ilTabs->activateSubTab('cal_ch_app_grp');
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroupTableGUI.php';
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
$gtbl = new ilConsultationHourGroupTableGUI($this,'groupList',$this->getUserId());
$tpl->setContent($gtbl->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::initFormSequence (   $a_mode)
protected

Init form.

Parameters
int$a_mode
Returns

Definition at line 680 of file class.ilConsultationHoursGUI.php.

References $options, ilConsultationHourGroups\getGroupSelectOptions(), getUserId(), IL_CAL_FREQ_DAILY, IL_CAL_FREQ_MONTHLY, IL_CAL_FREQ_WEEKLY, ilYuiUtil\initDomEvent(), ilRecurrenceInputGUI\setEnabledSubForms(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilTextAreaInputGUI\setRows(), ilDurationInputGUI\setShowMinutes(), ilDateTimeInputGUI\setShowTime(), ilTextInputGUI\setSize(), and ilNumberInputGUI\setSize().

Referenced by createSequence(), edit(), saveSequence(), and updateMulti().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
include_once('./Services/YUI/classes/class.ilYuiUtil.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
switch($a_mode)
{
case self::MODE_CREATE:
$this->form->setTitle($this->lng->txt('cal_ch_add_sequence'));
$this->form->addCommandButton('saveSequence', $this->lng->txt('save'));
$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
break;
/*
case self::MODE_UPDATE:
$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
break;
*/
case self::MODE_MULTI:
$this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence'));
$this->form->addCommandButton('updateMulti', $this->lng->txt('save'));
$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
break;
}
// in case of existing groups show a selection
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
{
$group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'),'grp');
$group->setOptions($options);
$group->setRequired(false);
$this->form->addItem($group);
}
// Title
$ti = new ilTextInputGUI($this->lng->txt('title'),'ti');
$ti->setSize(32);
$ti->setMaxLength(128);
$ti->setRequired(true);
$this->form->addItem($ti);
if($a_mode != self::MODE_MULTI)
{
// Start
include_once './Services/Form/classes/class.ilDateTimeInputGUI.php';
$dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'),'st');
$dur->setShowTime(true);
$dur->setMinuteStepSize(5);
$this->form->addItem($dur);
// Duration
$du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'),'du');
$du->setShowMinutes(true);
$du->setShowHours(true);
$this->form->addItem($du);
// Number of appointments
$nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'),'ap');
$nu->setInfo($this->lng->txt('cal_ch_num_appointments_info'));
$nu->setSize(2);
$nu->setMaxLength(2);
$nu->setRequired(true);
$nu->setMinValue(1);
$this->form->addItem($nu);
// Recurrence
include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
$rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'),'frequence');
array(
)
);
$this->form->addItem($rec);
}
// Number of bookings
$nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'),'bo');
$nu->setSize(2);
$nu->setMaxLength(2);
$nu->setMinValue(1);
$nu->setRequired(true);
$this->form->addItem($nu);
// Deadline
$dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'),'dead');
$dead->setInfo($this->lng->txt('cal_ch_deadline_info'));
$dead->setShowMinutes(false);
$dead->setShowHours(true);
$dead->setShowDays(true);
$this->form->addItem($dead);
// Location
$lo = new ilTextInputGUI($this->lng->txt('cal_where'),'lo');
$lo->setSize(32);
$lo->setMaxLength(128);
$this->form->addItem($lo);
// Description
$de = new ilTextAreaInputGUI($this->lng->txt('description'),'de');
$de->setRows(10);
$de->setCols(60);
$this->form->addItem($de);
// Target Object
$tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'),'tgt');
$tgt->setInfo($this->lng->txt('cal_ch_target_object_info'));
$tgt->setSize(16);
$tgt->setMaxLength(128);
$this->form->addItem($tgt);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::initGroupForm (   $a_group_id = 0)
protected

Init new/update group form.

Definition at line 481 of file class.ilConsultationHoursGUI.php.

References $GLOBALS.

Referenced by addGroup(), editGroup(), saveGroup(), and updateGroup().

{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$group = new ilConsultationHourGroup($a_group_id);
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
if($a_group_id)
{
$form->setTitle($GLOBALS['lng']->txt('cal_ch_grp_update_tbl'));
$form->addCommandButton('updateGroup', $GLOBALS['lng']->txt('save'));
$form->addCommandButton('groupList', $GLOBALS['lng']->txt('cancel'));
}
else
{
$form->setTitle($GLOBALS['lng']->txt('cal_ch_grp_add_tbl'));
$form->addCommandButton('saveGroup', $GLOBALS['lng']->txt('save'));
$form->addCommandButton('appointmentList', $GLOBALS['lng']->txt('cancel'));
}
$title = new ilTextInputGUI($GLOBALS['lng']->txt('title'),'title');
$title->setMaxLength(128);
$title->setSize(40);
$title->setRequired(true);
$title->setValue($group->getTitle());
$form->addItem($title);
$multiple = new ilNumberInputGUI($GLOBALS['lng']->txt('cal_ch_grp_multiple'),'multiple');
$multiple->setRequired(true);
$multiple->setMinValue(1);
$multiple->setSize(1);
$multiple->setMaxLength(2);
$multiple->setInfo($GLOBALS['lng']->txt('cal_ch_grp_multiple_info'));
$multiple->setValue($group->getMaxAssignments());
$form->addItem($multiple);
return $form;
}

+ Here is the caller graph for this function:

ilConsultationHoursGUI::initSettingsForm ( )
protected

build settings form

Returns
object

Definition at line 1270 of file class.ilConsultationHoursGUI.php.

References $ilUser, ilConsultationHourAppointments\getManager(), and ilFormPropertyGUI\setInfo().

Referenced by settings(), and updateSettings().

{
global $ilDB, $ilUser;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$mng = new ilTextInputGUI($this->lng->txt('cal_ch_manager'), 'mng');
$mng->setInfo($this->lng->txt('cal_ch_manager_info'));
$form->addItem($mng);
$form->setTitle($this->lng->txt('settings'));
$form->addCommandButton('updateSettings', $this->lng->txt('save'));
// $form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::rejectBooking (   $a_send_notification = true)
protected
Parameters
type$a_send_notification

Definition at line 612 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $ilCtrl, ilConsultationHourUtils\cancelBooking(), and ilUtil\sendSuccess().

Referenced by deleteBooking().

{
global $ilCtrl;
foreach((array) $_REQUEST['bookuser'] as $bookuser)
{
$ids = explode('_',$bookuser);
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
ilConsultationHourUtils::cancelBooking($ids[1],$ids[0],$a_send_notification);
}
if($a_send_notification)
{
ilUtil::sendSuccess($this->lng->txt('cal_ch_canceled_bookings'),true);
}
else
{
ilUtil::sendSuccess($this->lng->txt('cal_ch_deleted_bookings'),true);
}
$ilCtrl->redirect($this,'bookingList');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::saveGroup ( )
protected

Save new group.

Definition at line 358 of file class.ilConsultationHoursGUI.php.

References $GLOBALS, addGroup(), getUserId(), initGroupForm(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
$form = $this->initGroupForm();
if($form->checkInput())
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$group = new ilConsultationHourGroup();
$group->setTitle($form->getInput('title'));
$group->setMaxAssignments($form->getInput('multiple'));
$group->setUserId($this->getUserId());
$group->save();
ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'),true);
$GLOBALS['ilCtrl']->redirect($this,'groupList');
}
ilUtil::sendFailure($GLOBALS['lng']->txt('err_check_input'),true);
$this->addGroup($form);
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::saveSequence ( )
protected

Save new sequence.

Returns

Definition at line 807 of file class.ilConsultationHoursGUI.php.

References $booking, $ref_id, ilObject\_lookupType(), createAppointments(), ilConsultationHourGroups\getGroupsOfUser(), getUserId(), initFormSequence(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilObjDataCache;
$this->initFormSequence(self::MODE_CREATE);
if($this->form->checkInput())
{
$this->form->setValuesByPost();
$booking->setObjId($this->getUserId());
$booking->setNumberOfBookings($this->form->getInput('bo'));
$deadline = $this->form->getInput('dead');
$deadline = $deadline['dd'] * 24 + $deadline['hh'];
$booking->setDeadlineHours($deadline);
// consultation hour group
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
{
$booking->setBookingGroup((int) $this->form->getInput('grp'));
}
$tgt = explode(',',$this->form->getInput('tgt'));
$obj_ids = array();
foreach((array) $tgt as $ref_id)
{
if(!trim($ref_id))
{
continue;
}
$obj_id = $ilObjDataCache->lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
$valid_types = array('crs','grp');
if(!$obj_id or !in_array($type, $valid_types))
{
ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_repository_object'));
$this->tpl->setContent($this->form->getHTML());
return;
}
$obj_ids[] = $obj_id;
}
$booking->setTargetObjIds($obj_ids);
$booking->save();
ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
$this->ctrl->redirect($this,'appointmentList');
}
else
{
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
}
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::searchUsersForAppointments ( )
protected

start searching for users

Definition at line 161 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $_SESSION, $GLOBALS, $ilCtrl, executeCommand(), and ilUtil\sendFailure().

{
global $ilCtrl, $ilTabs;
$_SESSION['ch_apps'] = $_REQUEST['apps'];
if(!count($_SESSION['ch_apps']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$GLOBALS['ilCtrl']->redirect($this,'appointmentList');
}
$_REQUEST['assignM'] = 1;
$ilCtrl->setCmdClass('ilrepositorysearchgui');
$ilCtrl->setcmd('');
$this->executeCommand();
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::sendInfoAboutUnassignedUsers (   $unassigned)
protected

Send info message about unassigned users.

Parameters
array$unassigned

Definition at line 182 of file class.ilConsultationHoursGUI.php.

References $user_id, ilObjUser\_lookupFullname(), and ilUtil\sendInfo().

Referenced by assignUsersToAppointment(), assignUsersToAppointments(), and assignUsersToGroup().

{
if(!$unassigned)
{
return true;
}
$users = array();
foreach($unassigned as $user_id)
{
include_once './Services/User/classes/class.ilObjUser.php';
$users[] = ilObjUser::_lookupFullname($user_id);
}
ilUtil::sendInfo($this->lng->txt('cal_ch_user_assignment_failed_info').'<br />'.implode('<br />', $users),true);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::setSubTabs ( )
protected

Set sub tabs type $ilTabs type $ilCtrl.

Definition at line 963 of file class.ilConsultationHoursGUI.php.

References $ilCtrl, and getUserId().

Referenced by addGroup(), appointmentList(), bookingList(), confirmDeleteGroup(), confirmRejectBooking(), editGroup(), and groupList().

{
global $ilTabs, $ilCtrl;
$ilCtrl->setParameter($this,'user_id',$this->getUserId());
$ilTabs->addSubTab('cal_ch_app_list',$this->lng->txt('cal_ch_app_list'),$ilCtrl->getLinkTarget($this,'appointmentList'));
$ilTabs->addSubTab('cal_ch_app_grp',$this->lng->txt('cal_ch_app_grp'),$ilCtrl->getLinkTarget($this,'groupList'));
$ilTabs->addSubTab('cal_ch_app_bookings',$this->lng->txt('cal_ch_app_bookings'),$ilCtrl->getLinkTarget($this,'bookingList'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::setTabs ( )
protected

Set tabs.

Returns

Definition at line 939 of file class.ilConsultationHoursGUI.php.

References $ilCtrl, $ilUser, $user_id, ilConsultationHourAppointments\getManagedUsers(), and getUserId().

Referenced by executeCommand().

{
global $ilTabs, $ilUser, $ilCtrl;
$ilCtrl->setParameter($this, 'user_id', '');
$ilTabs->addTab('consultation_hours_'.$ilUser->getId(), $this->lng->txt('cal_ch_ch'), $this->ctrl->getLinkTarget($this,'appointmentList'));
{
$ilCtrl->setParameter($this, 'user_id', $user_id);
$ilTabs->addTab('consultation_hours_'.$user_id, $this->lng->txt('cal_ch_ch').': '.$login, $this->ctrl->getLinkTarget($this,'appointmentList'));
}
$ilCtrl->setParameter($this, 'user_id', '');
$ilTabs->addTab('ch_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this,'settings'));
$ilTabs->activateTab('consultation_hours_'.$this->getUserId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilConsultationHoursGUI::settings ( )

display settings gui

Definition at line 1255 of file class.ilConsultationHoursGUI.php.

References $tpl, and initSettingsForm().

{
global $tpl, $ilTabs, $ilHelp;
$ilHelp->setScreenId("consultation_hours_settings");
$ilTabs->activateTab('ch_settings');
$form = $this->initSettingsForm();
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::showProfile ( )

show public profile of given user

Definition at line 1213 of file class.ilConsultationHoursGUI.php.

References $_GET, $ilCtrl, $tpl, $user_id, and getProfileBackUrl().

{
global $tpl, $ilTabs, $ilCtrl;
$ilTabs->clearTargets();
$user_id = (int)$_GET['user'];
include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
$profile->setBackUrl($this->getProfileBackUrl());
$tpl->setContent($ilCtrl->getHTML($profile));
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::updateGroup ( )
protected

Update group type $ilCtrl type $tpl type $ilTabs.

Definition at line 404 of file class.ilConsultationHoursGUI.php.

References $_REQUEST, $GLOBALS, $ilCtrl, $tpl, editGroup(), getUserId(), initGroupForm(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilCtrl, $tpl, $ilTabs;
$ilCtrl->setParameter($this,'grp_id',(int) $_REQUEST['grp_id']);
$form = $this->initGroupForm((int) $_REQUEST['grp_id']);
if($form->checkInput())
{
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
$group = new ilConsultationHourGroup((int) $_REQUEST['grp_id']);
$group->setTitle($form->getInput('title'));
$group->setMaxAssignments($form->getInput('multiple'));
$group->setUserId($this->getUserId());
$group->update();
ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'),true);
$GLOBALS['ilCtrl']->redirect($this,'groupList');
}
ilUtil::sendFailure($GLOBALS['lng']->txt('err_check_input'),true);
$this->editGroup($form);
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::updateMulti ( )
protected

Update multiple sequence items.

Returns

Definition at line 1035 of file class.ilConsultationHoursGUI.php.

References $_POST, $booking, $location, $ref_id, ilObject\_lookupType(), edit(), ilConsultationHourGroups\getCountGroupsOfUser(), ilBookingEntry\getInstanceByCalendarEntryId(), getUserId(), initFormSequence(), ilBookingEntry\removeObsoleteEntries(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilObjDataCache;
$this->initFormSequence(self::MODE_MULTI);
if($this->form->checkInput())
{
$this->form->setValuesByPost();
$apps = explode(';', $_POST['apps']);
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
// do collision-check if max bookings were reduced
// no collision check
$first = $apps;
$first = array_shift($first);
#if($this->form->getInput('bo') < $entry->getNumberOfBookings())
#{
# $this->edit();
# return;
#}
// create new context
$booking->setObjId($this->getUserId());
$booking->setNumberOfBookings($this->form->getInput('bo'));
$deadline = $this->form->getInput('dead');
$deadline = $deadline['dd']*24+$deadline['hh'];
$booking->setDeadlineHours($deadline);
$tgt = explode(',',$this->form->getInput('tgt'));
$obj_ids = array();
foreach((array) $tgt as $ref_id)
{
if(!trim($ref_id))
{
continue;
}
$obj_id = $ilObjDataCache->lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
$valid_types = array('crs','grp');
if(!$obj_id or !in_array($type, $valid_types))
{
ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_repository_object'));
$this->edit();
return;
}
$obj_ids[] = $obj_id;
}
$booking->setTargetObjIds($obj_ids);
include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
{
$booking->setBookingGroup($this->form->getInput('grp'));
}
$booking->save();
// update entries
$title = $this->form->getInput('ti');
$location = $this->form->getInput('lo');
$description = $this->form->getInput('de');
foreach($apps as $item_id)
{
$entry = new ilCalendarEntry($item_id);
$entry->setContextId($booking->getId());
$entry->setTitle($title);
$entry->setLocation($location);
$entry->setDescription($description);
$entry->update();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
$this->ctrl->redirect($this,'appointmentList');
}
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilConsultationHoursGUI::updateSettings ( )

save settings

Definition at line 1294 of file class.ilConsultationHoursGUI.php.

References $ilCtrl, $ilUser, $tpl, initSettingsForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilConsultationHourAppointments\setManager().

{
global $ilDB, $ilCtrl, $ilUser, $tpl, $ilTabs;
$form = $this->initSettingsForm();
if($form->checkInput())
{
$mng = $form->getInput('mng');
{
ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
$ilCtrl->redirect($this, 'settings');
}
else
{
$ilTabs->activateTab('ch_settings');
ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_user'));
$field = $form->getItemByPostVar('mng');
$field->setValue($mng);
$tpl->setContent($form->getHTML());
return;
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilConsultationHoursGUI::$booking = null
protected
ilConsultationHoursGUI::$ctrl
protected

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

ilConsultationHoursGUI::$user_id
protected
const ilConsultationHoursGUI::MODE_CREATE = 1

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

const ilConsultationHoursGUI::MODE_MULTI = 3

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

const ilConsultationHoursGUI::MODE_UPDATE = 2

Definition at line 37 of file class.ilConsultationHoursGUI.php.


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