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

Consultation hours editor. More...

+ Collaboration diagram for ilConsultationHoursGUI:

Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

 $user_id
 
 $ctrl
 
 $booking = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilConsultationHoursGUI::__construct ( )

Constructor.

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

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

51  {
52  global $DIC;
53 
54  $lng = $DIC['lng'];
55  $ilCtrl = $DIC['ilCtrl'];
56  $tpl = $DIC['tpl'];
57  $ilUser = $DIC['ilUser'];
58 
59  $user_id = (int) $_GET['user_id'];
60  if ($user_id) {
61  if (in_array($user_id, array_keys(ilConsultationHourAppointments::getManagedUsers()))) {
62  $this->user_id = $user_id;
63  } else {
64  $user_id = false;
65  }
66  }
67  if (!$user_id) {
68  $this->user_id = $ilUser->getId();
69  }
70 
71  $this->ctrl = $ilCtrl;
72  $this->lng = $lng;
73  $this->tpl = $tpl;
74  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
static getManagedUsers()
Get all managed consultation hours users for current users.
$lng
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ addGroup()

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

Show add group form type $ilToolbar type $ilTabs.

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

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

Referenced by saveGroup().

349  {
350  global $DIC;
351 
352  $ilTabs = $DIC['ilTabs'];
353  $tpl = $DIC['tpl'];
354 
355  $this->setSubTabs();
356  $ilTabs->activateSubTab('cal_ch_app_grp');
357 
358  if ($form == null) {
359  $form = $this->initGroupForm();
360  }
361  $tpl->setContent($form->getHTML());
362  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
initGroupForm($a_group_id=0)
Init new/update group form.
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appointmentList()

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 658 of file class.ilConsultationHoursGUI.php.

References $DIC, $tbl, getUserId(), and setSubTabs().

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

659  {
660  global $DIC;
661 
662  $ilToolbar = $DIC['ilToolbar'];
663  $ilHelp = $DIC['ilHelp'];
664  $ilTabs = $DIC['ilTabs'];
665 
666  $ilHelp->setScreenId("consultation_hours");
667 
668  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
669  $ilToolbar->addButton($this->lng->txt('cal_ch_add_sequence'), $this->ctrl->getLinkTarget($this, 'createSequence'));
670 
671  $this->setSubTabs();
672  $ilTabs->activateSubTab('cal_ch_app_list');
673 
674  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursTableGUI.php';
675  $tbl = new ilConsultationHoursTableGUI($this, 'appointmentList', $this->getUserId());
676  $tbl->parse();
677  $this->tpl->setContent($tbl->getHTML());
678  }
global $DIC
Definition: saml.php:7
$tbl
Definition: example_048.php:81
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
Consultation hours administration.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignUsersToAppointment()

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 226 of file class.ilConsultationHoursGUI.php.

References $booking, $DIC, $GLOBALS, $ilCtrl, $user, ilConsultationHourUtils\bookAppointment(), ilBookingEntry\getInstanceByCalendarEntryId(), ilBookingEntry\lookupBookingsOfUser(), ilUtil\sendFailure(), and sendInfoAboutUnassignedUsers().

Referenced by assignUsersToAppointments().

227  {
228  global $DIC;
229 
230  $ilCtrl = $DIC['ilCtrl'];
231 
232  if ($a_app) {
233  $app = $a_app;
234  } else {
235  $app = $_REQUEST['apps'];
236  }
237 
238  if (!count($users)) {
239  ilUtil::sendFailure($GLOBALS['DIC']->language()->txt('select_one'), true);
240  return false;
241  }
242 
243 
244  include_once './Services/Booking/classes/class.ilBookingEntry.php';
246 
247  $assigned_users = array();
248  foreach ($users as $user) {
249  if ($booking->getCurrentNumberOfBookings($app) >= $booking->getNumberOfBookings()) {
250  break;
251  }
252  if (!ilBookingEntry::lookupBookingsOfUser((array) $app, $user)) {
253  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
255  $assigned_users[] = $user;
256  }
257  }
258 
259  $unassigned_users = array_diff($users, $assigned_users);
260 
261  if ($a_redirect) {
262  $this->sendInfoAboutUnassignedUsers($unassigned_users);
263  $ilCtrl->redirect($this, 'appointmentList');
264  } else {
265  return $unassigned_users;
266  }
267  }
global $DIC
Definition: saml.php:7
static getInstanceByCalendarEntryId($a_id)
Get instance by calendar entry.
global $ilCtrl
Definition: ilias.php:18
sendInfoAboutUnassignedUsers($unassigned)
Send info message about unassigned users.
$user
Definition: migrateto20.php:57
static lookupBookingsOfUser($a_app_ids, $a_usr_id, ilDateTime $start=null)
Lookup bookings if user.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignUsersToAppointments()

ilConsultationHoursGUI::assignUsersToAppointments ( array  $users)

Assign users to multiple appointments.

Parameters
type$users

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

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

206  {
207  global $DIC;
208 
209  $ilCtrl = $DIC['ilCtrl'];
210 
211  $unassigned_users = array();
212  foreach ($_SESSION['ch_apps'] as $app) {
213  $unassigned_users = array_unique(array_merge($unassigned_users, $this->assignUsersToAppointment($users, $app, false)));
214  }
215 
216  $this->sendInfoAboutUnassignedUsers($unassigned_users);
217  $ilCtrl->redirect($this, 'appointmentList');
218  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
sendInfoAboutUnassignedUsers($unassigned)
Send info message about unassigned users.
$users
Definition: authpage.php:44
assignUsersToAppointment(array $users, $a_app=0, $a_redirect=true)
Assign users to an appointment.
+ Here is the call graph for this function:

◆ assignUsersToGroup()

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

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

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

275  {
276  global $DIC;
277 
278  $ilCtrl = $DIC['ilCtrl'];
279 
280  $group_id = (int) $_REQUEST['grp_id'];
281 
282  $tomorrow = new ilDateTime(time(), IL_CAL_UNIX);
283  $tomorrow->increment(IL_CAL_DAY, 1);
284 
285  // Get all future consultation hours
286  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
287  include_once './Services/Booking/classes/class.ilBookingEntry.php';
289  $this->user_id,
290  $group_id,
291  $tomorrow
292  );
293  $users = $usr_ids;
294  $assigned_users = array();
295  foreach ($apps as $app) {
297  foreach ($users as $user) {
298  if ($booking->getCurrentNumberOfBookings($app) >= $booking->getNumberOfBookings()) {
299  break;
300  }
301  if (!ilBookingEntry::lookupBookingsOfUser($apps, $user)) {
302  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
304  $assigned_users[] = $user;
305  }
306  }
307  }
308 
309  $this->sendInfoAboutUnassignedUsers(array_diff($users, $assigned_users));
310  $ilCtrl->redirect($this, 'bookingList');
311  }
global $DIC
Definition: saml.php:7
static getInstanceByCalendarEntryId($a_id)
Get instance by calendar entry.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
const IL_CAL_DAY
Date and time handling
sendInfoAboutUnassignedUsers($unassigned)
Send info message about unassigned users.
static getAppointmentIdsByGroup($a_user_id, $a_ch_group_id, ilDateTime $start=null)
Get appointment ids by consultation hour group.
$user
Definition: migrateto20.php:57
static lookupBookingsOfUser($a_app_ids, $a_usr_id, ilDateTime $start=null)
Lookup bookings if user.
$users
Definition: authpage.php:44
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.
+ Here is the call graph for this function:

◆ bookingList()

ilConsultationHoursGUI::bookingList ( )
protected

Show list of bookings.

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

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

541  {
542  global $DIC;
543 
544  $ilToolbar = $DIC['ilToolbar'];
545  $ilTabs = $DIC['ilTabs'];
546  $tpl = $DIC['tpl'];
547  $ilHelp = $DIC['ilHelp'];
548 
549  $ilHelp->setScreenId("consultation_hours");
550 
551  $this->setSubTabs();
552  $ilTabs->activateSubTab('cal_ch_app_bookings');
553 
554  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourBookingTableGUI.php';
555  $btable = new ilConsultationHourBookingTableGUI($this, 'bookingList', $this->getUserId());
557  $tpl->setContent($btable->getHTML());
558  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
+ Here is the call graph for this function:

◆ confirmDelete()

ilConsultationHoursGUI::confirmDelete ( )

confirm delete for multiple entries

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

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

1171  {
1172  global $DIC;
1173 
1174  $tpl = $DIC['tpl'];
1175 
1176  if (!isset($_REQUEST['apps'])) {
1177  ilUtil::sendFailure($this->lng->txt('select_one'));
1178  return $this->appointmentList();
1179  }
1180 
1181  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1182 
1183 
1184  $this->ctrl->saveParameter($this, array('seed','app_id','dt'));
1185 
1186  $confirm = new ilConfirmationGUI();
1187  $confirm->setFormAction($this->ctrl->getFormAction($this));
1188  $confirm->setHeaderText($this->lng->txt('cal_delete_app_sure'));
1189  $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
1190 
1191  include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
1192 
1193  $bookings_available = array();
1194  foreach ((array) $_REQUEST['apps'] as $entry_id) {
1195  $entry = new ilCalendarEntry($entry_id);
1196  $confirm->addItem('apps[]', $entry_id, ilDatePresentation::formatDate($entry->getStart()) . ', ' . $entry->getTitle());
1197 
1198  include_once './Services/Booking/classes/class.ilBookingEntry.php';
1200  $bookings_available[] = ilDatePresentation::formatDate($entry->getStart()) . ', ' . $entry->getTitle();
1201  }
1202  }
1203 
1204  if ($bookings_available) {
1205  ilUtil::sendInfo($this->lng->txt('cal_ch_delete_app_booking_info') . '<br />' . implode('<br />', $bookings_available));
1206  }
1207 
1208  $confirm->setConfirm($this->lng->txt('delete'), 'delete');
1209  $confirm->setCancel($this->lng->txt('cancel'), 'appointmentList');
1210 
1211  $tpl->setContent($confirm->getHTML());
1212  }
Model for a calendar entry.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupBookingsForAppointment($a_app_id)
Lookup booked users for appointment type $ilDB.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
appointmentList()
Show settings of consultation hours.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteBooking()

ilConsultationHoursGUI::confirmDeleteBooking ( )
protected

Show delete booking confirmation.

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

References confirmRejectBooking().

564  {
565  $this->confirmRejectBooking(false);
566  }
confirmRejectBooking($a_send_notification=true)
Show delete booking confirmation.
+ Here is the call graph for this function:

◆ confirmDeleteGroup()

ilConsultationHoursGUI::confirmDeleteGroup ( )
protected

Confirm delete type $ilCtrl type $ilTabs.

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

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

448  {
449  global $DIC;
450 
451  $ilCtrl = $DIC['ilCtrl'];
452  $ilTabs = $DIC['ilTabs'];
453  $tpl = $DIC['tpl'];
454 
455  $ilCtrl->setParameter($this, 'grp_id', (int) $_REQUEST['grp_id']);
456  $groups = array((int) $_REQUEST['grp_id']);
457 
458  $this->setSubTabs();
459  $ilTabs->activateSubTab('cal_ch_app_grp');
460 
461 
462  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
463  $confirm = new ilConfirmationGUI();
464  $confirm->setFormAction($ilCtrl->getFormAction($this));
465  $confirm->setHeaderText($GLOBALS['DIC']['lng']->txt('cal_ch_grp_delete_sure'));
466  $confirm->setConfirm($GLOBALS['DIC']['lng']->txt('delete'), 'deleteGroup');
467  $confirm->setCancel($GLOBALS['DIC']['lng']->txt('cancel'), 'groupList');
468 
469  foreach ($groups as $grp_id) {
470  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
471  $group = new ilConsultationHourGroup($grp_id);
472 
473  $confirm->addItem('groups[]', $grp_id, $group->getTitle());
474  }
475  $tpl->setContent($confirm->getHTML());
476  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRejectBooking()

ilConsultationHoursGUI::confirmRejectBooking (   $a_send_notification = true)
protected

Show delete booking confirmation.

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

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

Referenced by confirmDeleteBooking().

572  {
573  global $DIC;
574 
575  $ilTabs = $DIC['ilTabs'];
576  $tpl = $DIC['tpl'];
577 
578  $this->setSubTabs();
579  $ilTabs->activateSubTab('cal_ch_app_bookings');
580 
581  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
582 
583  $confirm = new ilConfirmationGUI();
584  $confirm->setFormAction($this->ctrl->getFormAction($this));
585 
586  if ($a_send_notification) {
587  ilUtil::sendInfo($this->lng->txt('cal_ch_cancel_booking_info'));
588  $confirm->setHeaderText($this->lng->txt('cal_ch_cancel_booking_sure'));
589  $confirm->setConfirm($this->lng->txt('cal_ch_reject_booking'), 'rejectBooking');
590  } else {
591  ilUtil::sendInfo($this->lng->txt('cal_ch_delete_booking_info'));
592  $confirm->setHeaderText($this->lng->txt('cal_ch_delete_booking_sure'));
593  $confirm->setConfirm($this->lng->txt('cal_ch_delete_booking'), 'deleteBooking');
594  }
595 
596  $confirm->setCancel($this->lng->txt('cancel'), 'bookingList');
597 
598  include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
599  foreach ((array) $_REQUEST['bookuser'] as $bookuser) {
600  $ids = explode('_', $bookuser);
601 
602  include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
603  include_once './Services/User/classes/class.ilUserUtil.php';
604  $entry = new ilCalendarEntry($ids[0]);
605  $confirm->addItem(
606  'bookuser[]',
607  $bookuser,
609  $ids[1],
610  true,
611  false,
612  '',
613  true,
614  true
615  ) . ', ' . ilDatePresentation::formatDate($entry->getStart())
616  );
617  }
618  $tpl->setContent($confirm->getHTML());
619  }
Model for a calendar entry.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAppointments()

ilConsultationHoursGUI::createAppointments ( ilBookingEntry  $booking)
protected

Create calendar appointments.

Parameters
ilBookingEntry$booking
Returns

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

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

Referenced by saveSequence().

889  {
890  include_once './Services/Calendar/classes/class.ilDateList.php';
891  $concurrent_dates = new ilDateList(ilDateList::TYPE_DATETIME);
892  $start = clone $this->form->getItemByPostVar('st')->getDate();
893  for ($i = 0; $i < $this->form->getItemByPostVar('ap')->getValue(); $i++) {
894  $concurrent_dates->add(clone $start);
895 
896  $start->increment(ilDateTime::MINUTE, $this->form->getItemByPostVar('du')->getMinutes());
897  $start->increment(ilDateTime::HOUR, $this->form->getItemByPostVar('du')->getHours());
898  #$start = new ilDateTime(,IL_CAL_UNIX);
899  }
900 
901  include_once './Services/Calendar/classes/class.ilCalendarUtil.php';
902  $def_cat = ilCalendarUtil::initDefaultCalendarByType(ilCalendarCategory::TYPE_CH, $this->getUserId(), $this->lng->txt('cal_ch_personal_ch'), true);
903 
904  // Add calendar appointment for each
905  include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
906  include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
907  include_once './Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
908  include_once './Services/Booking/classes/class.ilBookingPeriod.php';
909 
910  $num_appointments = 0;
911  foreach ($concurrent_dates as $dt) {
912  if ($num_appointments >= self::MAX_APPOINTMENTS_PER_SEQUENCE) {
913  break;
914  }
915 
916  $end = clone $dt;
917  $end->increment(ilDateTime::MINUTE, $this->form->getItemByPostVar('du')->getMinutes());
918  $end->increment(ilDateTime::HOUR, $this->form->getItemByPostVar('du')->getHours());
919 
920  $calc = new ilCalendarRecurrenceCalculator(
921  new ilBookingPeriod($dt, $end),
922  $this->form->getItemByPostVar('frequence')->getRecurrence()
923  );
924 
925  // Calculate with one year limit
926  $limit = clone $dt;
927  $limit->increment(ilDateTime::YEAR, 1);
928 
929  $date_list = $calc->calculateDateList($dt, $limit);
930 
931  $num = 0;
932  foreach ($date_list as $app_start) {
933  $app_end = clone $app_start;
934  $app_end->increment(ilDateTime::MINUTE, $this->form->getItemByPostVar('du')->getMinutes());
935  $app_end->increment(ilDateTime::HOUR, $this->form->getItemByPostVar('du')->getHours());
936 
937 
938  $entry = new ilCalendarEntry();
939  $entry->setContextId($booking->getId());
940  $entry->setTitle($this->form->getInput('ti'));
941  $entry->setSubtitle("#consultationhour#"); // dynamic, see ilCalendarEntry
942  $entry->setDescription($this->form->getInput('de'));
943  $entry->setLocation($this->form->getInput('lo'));
944  $entry->setStart($app_start);
945  $entry->setEnd($app_end);
946 
947  $entry->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
948  $entry->save();
949 
950  $cat_assign = new ilCalendarCategoryAssignments($entry->getEntryId());
951  $cat_assign->addAssignment($def_cat->getCategoryID());
952 
953  $num_appointments++;
954  }
955  }
956  }
Model for a calendar entry.
const IL_CAL_TRANSLATION_SYSTEM
$start
Definition: bench.php:8
calculateDateList(ilDateTime $a_start, ilDateTime $a_end, $a_limit=-1)
calculate date list
Calculates an ilDateList for a given calendar entry and recurrence rule.
List of dates.
static initDefaultCalendarByType($a_type_id, $a_usr_id, $a_title, $a_create=false)
Init the default calendar for given type and user.
$i
Definition: disco.tpl.php:19
Booking period Used for calculation of recurring events.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewBookingEntry()

ilConsultationHoursGUI::createNewBookingEntry ( \ilPropertyFormGUI  $validate_form)
protected
Parameters
ilPropertyFormGUI$validated_form
Returns
| null

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

References $booking, $DIC, $type, ilObject\_lookupType(), ilConsultationHourGroups\getCountGroupsOfUser(), getUserId(), and ilUtil\sendFailure().

Referenced by updateMulti().

1063  {
1064  global $DIC;
1065 
1066  $obj_cache = $DIC['ilObjDataCache'];
1067 
1068  $booking = new \ilBookingEntry();
1069  $booking->setObjId($this->user_id);
1070  $booking->setNumberOfBookings((int) $this->form->getInput('bo'));
1071 
1072  $deadline = $this->form->getInput('dead');
1073  $deadline = $deadline['dd'] * 24 + $deadline['hh'];
1074  $booking->setDeadlineHours($deadline);
1075 
1076  $tgt = explode(',', (string) $this->form->getInput('tgt'));
1077  $obj_ids = [];
1078  foreach ((array) $tgt as $ref_id) {
1079  if (!trim($ref_id)) {
1080  continue;
1081  }
1082  $obj_id = $obj_cache->lookupObjId($ref_id);
1083  $type = ilObject::_lookupType($obj_id);
1084  $valid_types = ['crs', 'grp'];
1085  if (!$obj_id or !in_array($type, $valid_types)) {
1086  ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_repository_object'));
1087  return null;
1088  }
1089  $obj_ids[] = $obj_id;
1090  }
1091  $booking->setTargetObjIds($obj_ids);
1092 
1094  $booking->setBookingGroup($this->form->getInput('grp'));
1095  }
1096  $booking->save();
1097  return $booking;
1098  }
$type
global $DIC
Definition: saml.php:7
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getCountGroupsOfUser($a_user_id)
Get number of consultation hour groups type $ilDB.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createSequence()

ilConsultationHoursGUI::createSequence ( )
protected

Create new sequence.

Returns

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

References IL_CAL_UNIX, and initFormSequence().

685  {
686  $this->initFormSequence(self::MODE_CREATE);
687 
688  $this->booking = new ilBookingEntry();
689  $this->form->getItemByPostVar('bo')->setValue($this->booking->getNumberOfBookings());
690  $this->form->getItemByPostVar('ap')->setValue(1);
691  $this->form->getItemByPostVar('du')->setMinutes(15);
692  $this->form->getItemByPostVar('st')->setDate(
693  new ilDateTime(mktime(8, 0, 0, date('n', time()), date('d', time()), date('Y', time())), IL_CAL_UNIX)
694  );
695 
696  $this->tpl->setContent($this->form->getHTML());
697  }
Booking definition.
const IL_CAL_UNIX
Date and time handling
+ Here is the call graph for this function:

◆ delete()

ilConsultationHoursGUI::delete ( )

delete multiple entries

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

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

1218  {
1219  if (!isset($_POST['apps'])) {
1220  ilUtil::sendFailure($this->lng->txt('select_one'));
1221  return $this->appointmentList();
1222  }
1223 
1224  include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
1225  include_once 'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1226  foreach ($_POST['apps'] as $entry_id) {
1227  // cancel booking for users
1229  if ($booking) {
1230  foreach ($booking->getCurrentBookings($entry_id) as $user_id) {
1231  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
1233  }
1234  }
1235  // remove calendar entries
1236  include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
1237  $entry = new ilCalendarEntry($entry_id);
1238  $entry->delete();
1239 
1241  }
1242 
1244 
1245  ilUtil::sendSuccess($this->lng->txt('cal_deleted_app'), true);
1246  $this->ctrl->redirect($this, 'appointmentList');
1247  }
Model for a calendar entry.
static removeObsoleteEntries()
Remove unused booking entries.
static getInstanceByCalendarEntryId($a_id)
Get instance by calendar entry.
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static cancelBooking($a_usr_id, $a_app_id, $a_send_notification=true)
Cancel a booking.
appointmentList()
Show settings of consultation hours.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteBooking()

ilConsultationHoursGUI::deleteBooking ( )
protected

Delete booking.

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

References rejectBooking().

625  {
626  $this->rejectBooking(false);
627  }
rejectBooking($a_send_notification=true)
+ Here is the call graph for this function:

◆ deleteGroup()

ilConsultationHoursGUI::deleteGroup ( )
protected

Delete groups.

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

References $DIC, $GLOBALS, and $ilCtrl.

482  {
483  global $DIC;
484 
485  $ilCtrl = $DIC['ilCtrl'];
486 
487  foreach ((array) $_REQUEST['groups'] as $grp_id) {
488  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
489  $group = new ilConsultationHourGroup($grp_id);
490  $group->delete();
491  }
492  ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('cal_ch_grp_deleted'));
493  $ilCtrl->redirect($this, 'groupList');
494  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ edit()

ilConsultationHoursGUI::edit ( )

Edit multiple sequence items.

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

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

Referenced by updateMulti().

1006  {
1007  global $DIC;
1008 
1009  $ilTabs = $DIC['ilTabs'];
1010 
1011  if (!isset($_REQUEST['apps'])) {
1012  ilUtil::sendFailure($this->lng->txt('select_one'));
1013  return $this->appointmentList();
1014  }
1015 
1016  $this->initFormSequence(self::MODE_MULTI);
1017 
1018  if ($_REQUEST['apps'] && !is_array($_REQUEST['apps'])) {
1019  $_REQUEST['apps'] = explode(';', $_REQUEST['apps']);
1020  }
1021 
1022  $hidden = new ilHiddenInputGUI('apps');
1023  $hidden->setValue(implode(';', $_REQUEST['apps']));
1024  $this->form->addItem($hidden);
1025 
1026  include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
1027  $first = $_REQUEST['apps'];
1028  $first = array_shift($_REQUEST['apps']);
1029  $entry = new ilCalendarEntry($first);
1030 
1031  $this->form->getItemByPostVar('ti')->setValue($entry->getTitle());
1032  $this->form->getItemByPostVar('lo')->setValue($entry->getLocation());
1033  $this->form->getItemByPostVar('de')->setValue($entry->getDescription());
1034 
1035  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
1036  $booking = new ilBookingEntry($entry->getContextId());
1037 
1038  $this->form->getItemByPostVar('bo')->setValue($booking->getNumberOfBookings());
1039 
1040  $ref_ids = array();
1041  foreach ($booking->getTargetObjIds() as $obj_id) {
1042  $refs = ilObject::_getAllReferences($obj_id);
1043  $ref_ids[] = end($refs);
1044  }
1045  $this->form->getItemByPostVar('tgt')->setValue(implode(',', $ref_ids));
1046 
1047  $deadline = $booking->getDeadlineHours();
1048  $this->form->getItemByPostVar('dead')->setDays(floor($deadline / 24));
1049  $this->form->getItemByPostVar('dead')->setHours($deadline % 24);
1050 
1051  if ($booking->getBookingGroup()) {
1052  $this->form->getItemByPostVar('grp')->setValue($booking->getBookingGroup());
1053  }
1054 
1055  $this->tpl->setContent($this->form->getHTML());
1056  }
Model for a calendar entry.
global $DIC
Definition: saml.php:7
Booking definition.
static _getAllReferences($a_id)
get all reference ids of object
This class represents a hidden form property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
appointmentList()
Show settings of consultation hours.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editGroup()

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

Edit group type $ilCtrl.

Parameters
ilPropertyFormGUI$form

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

References $DIC, $form, $ilCtrl, $tpl, initGroupForm(), and setSubTabs().

Referenced by updateGroup().

392  {
393  global $DIC;
394 
395  $ilCtrl = $DIC['ilCtrl'];
396  $tpl = $DIC['tpl'];
397  $ilTabs = $DIC['ilTabs'];
398 
399  $ilCtrl->setParameter($this, 'grp_id', (int) $_REQUEST['grp_id']);
400  $this->setSubTabs();
401  $ilTabs->activateSubTab('cal_ch_app_grp');
402 
403  if ($form == null) {
404  $form = $this->initGroupForm((int) $_REQUEST['grp_id']);
405  }
406  $tpl->setContent($form->getHTML());
407  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
initGroupForm($a_group_id=0)
Init new/update group form.
global $ilCtrl
Definition: ilias.php:18
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilConsultationHoursGUI::executeCommand ( )

Execute command.

Returns

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

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

Referenced by searchUsersForAppointments().

81  {
82  global $DIC;
83 
84  $ilUser = $DIC['ilUser'];
85  $ilCtrl = $DIC['ilCtrl'];
86  $tpl = $DIC['tpl'];
87  $ilHelp = $DIC['ilHelp'];
88  $ilTabs = $DIC['ilTabs'];
89 
90  $ilHelp->setScreenIdComponent("cal");
91 
92  switch ($this->ctrl->getNextClass()) {
93  case "ilpublicuserprofilegui":
94  include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
95  #22168 don't send the current user if no GET user_id
96  //$profile = new ilPublicUserProfileGUI($this->user_id);
97  $profile = new ilPublicUserProfileGUI();
98  $profile->setBackUrl($this->getProfileBackUrl());
99  $ret = $ilCtrl->forwardCommand($profile);
100  $tpl->setContent($ret);
101  break;
102 
103  case 'ilrepositorysearchgui':
104 
105  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
106  $rep_search = new ilRepositorySearchGUI();
107 
108  if (isset($_REQUEST['assignM'])) {
109  $rep_search->setCallback(
110  $this,
111  'assignUsersToAppointments',
112  array()
113  );
114  $ilCtrl->setParameter($this, 'assignM', 1);
115  $ilCtrl->setReturn($this, 'appointmentList');
116  $ilTabs->activateSubTab('cal_ch_app_list');
117  } elseif (isset($_REQUEST['grp_id'])) {
118  $rep_search->setCallback(
119  $this,
120  'assignUsersToGroup',
121  array()
122  );
123  $ilCtrl->saveParameter($this, 'grp_id');
124  $ilCtrl->setReturn($this, 'groupList');
125  $ilTabs->activateSubTab('cal_ch_app_grp');
126  } elseif (isset($_REQUEST['apps'])) {
127  $rep_search->setCallback(
128  $this,
129  'assignUsersToAppointment',
130  array()
131  );
132  $ilCtrl->saveParameter($this, 'apps');
133  $ilCtrl->setReturn($this, 'appointmentList');
134  $ilTabs->activateSubTab('cal_ch_app_list');
135  }
136  $ilCtrl->forwardCommand($rep_search);
137  break;
138 
139  default:
140  $tpl->setTitle($this->lng->txt("cal_ch_form_header")); // #12220
141 
142  $this->setTabs();
143  if ($ilUser->getId() != $this->user_id) {
144  $ilCtrl->setParameter($this, 'user_id', $this->user_id);
145  }
146 
147  $cmd = $this->ctrl->getCmd('appointmentList');
148  $this->$cmd();
149  }
150  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
GUI class for public user profile presentation.
$ilUser
Definition: imgupload.php:18
$ret
Definition: parser.php:6
getProfileBackUrl()
Build context-sensitive profile back url.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfileBackUrl()

ilConsultationHoursGUI::getProfileBackUrl ( )
protected

Build context-sensitive profile back url.

Returns
string

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

References $_GET, and $url.

Referenced by executeCommand(), and showProfile().

1276  {
1277  // from repository
1278  if (isset($_REQUEST["ref_id"])) {
1279  $url = $this->ctrl->getLinkTargetByClass('ilCalendarMonthGUI');
1280  }
1281  // from panel
1282  elseif (isset($_GET['panel'])) {
1283  $url = $this->ctrl->getLinkTargetByClass('ilCalendarPresentationGUI');
1284  }
1285  // from appointments
1286  else {
1287  $url = $this->ctrl->getLinkTarget($this, 'appointmentList');
1288  }
1289  return $url;
1290  }
$_GET["client_id"]
$url
+ Here is the caller graph for this function:

◆ getUserId()

ilConsultationHoursGUI::getUserId ( )

Get user id.

Returns

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

References $user_id.

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

+ Here is the caller graph for this function:

◆ groupList()

ilConsultationHoursGUI::groupList ( )
protected

Show consultation hour group type $ilToolbar.

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

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

319  {
320  global $DIC;
321 
322  $ilToolbar = $DIC['ilToolbar'];
323  $ilTabs = $DIC['ilTabs'];
324  $tpl = $DIC['tpl'];
325  $ilHelp = $DIC['ilHelp'];
326 
327  $ilHelp->setScreenId("consultation_hours");
328 
329  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
330  $ilToolbar->addButton($this->lng->txt('cal_ch_add_grp'), $this->ctrl->getLinkTarget($this, 'addGroup'));
331 
332  $this->setSubTabs();
333  $ilTabs->activateSubTab('cal_ch_app_grp');
334 
335  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroupTableGUI.php';
336  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
337  $gtbl = new ilConsultationHourGroupTableGUI($this, 'groupList', $this->getUserId());
339 
340  $tpl->setContent($gtbl->getHTML());
341  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static getGroupsOfUser($a_user_id)
Get a all groups of an user.
setSubTabs()
Set sub tabs type $ilTabs type $ilCtrl.
+ Here is the call graph for this function:

◆ initFormSequence()

ilConsultationHoursGUI::initFormSequence (   $a_mode)
protected

Init form.

Parameters
int$a_mode
Returns

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

References PHPMailer\PHPMailer\$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().

705  {
706  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
707 
708  include_once('./Services/YUI/classes/class.ilYuiUtil.php');
710 
711  $this->form = new ilPropertyFormGUI();
712  $this->form->setFormAction($this->ctrl->getFormAction($this));
713 
714  switch ($a_mode) {
715  case self::MODE_CREATE:
716  $this->form->setTitle($this->lng->txt('cal_ch_add_sequence'));
717  $this->form->addCommandButton('saveSequence', $this->lng->txt('save'));
718  $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
719  break;
720 
721  /*
722  case self::MODE_UPDATE:
723  $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
724  $this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
725  $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
726  break;
727  */
728 
729  case self::MODE_MULTI:
730  $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence'));
731  $this->form->addCommandButton('updateMulti', $this->lng->txt('save'));
732  $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
733  break;
734  }
735 
736  // in case of existing groups show a selection
737  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
739  $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp');
740  $group->setOptions($options);
741  $group->setRequired(false);
742  $this->form->addItem($group);
743  }
744 
745  // Title
746  $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti');
747  $ti->setSize(32);
748  $ti->setMaxLength(128);
749  $ti->setRequired(true);
750  $this->form->addItem($ti);
751 
752  if ($a_mode != self::MODE_MULTI) {
753  // Start
754  include_once './Services/Form/classes/class.ilDateTimeInputGUI.php';
755  $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st');
756  $dur->setShowTime(true);
757  $dur->setRequired(true);
758  $this->form->addItem($dur);
759 
760  // Duration
761  $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du');
762  $du->setShowMinutes(true);
763  $du->setShowHours(true);
764  $this->form->addItem($du);
765 
766  // Number of appointments
767  $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap');
768  $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info'));
769  $nu->setSize(2);
770  $nu->setMaxLength(2);
771  $nu->setRequired(true);
772  $nu->setMinValue(1);
773  $this->form->addItem($nu);
774 
775  // Recurrence
776  include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
777  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
778  $rec->setEnabledSubForms(
779  array(
783  )
784  );
785  $this->form->addItem($rec);
786  }
787 
788  // Number of bookings
789  $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo');
790  $nu->setSize(2);
791  $nu->setMaxLength(2);
792  $nu->setMinValue(1);
793  $nu->setRequired(true);
794  $this->form->addItem($nu);
795 
796  // Deadline
797  $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead');
798  $dead->setInfo($this->lng->txt('cal_ch_deadline_info'));
799  $dead->setShowMinutes(false);
800  $dead->setShowHours(true);
801  $dead->setShowDays(true);
802  $this->form->addItem($dead);
803 
804  // Location
805  $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo');
806  $lo->setSize(32);
807  $lo->setMaxLength(128);
808  $this->form->addItem($lo);
809 
810  // Description
811  $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de');
812  $de->setRows(10);
813  $de->setCols(60);
814  $this->form->addItem($de);
815 
816  // Target Object
817  $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt');
818  $tgt->setInfo($this->lng->txt('cal_ch_target_object_info'));
819  $tgt->setSize(16);
820  $tgt->setMaxLength(128);
821  $this->form->addItem($tgt);
822  }
This class represents a duration (typical hh:mm:ss) property in a property form.
const IL_CAL_FREQ_MONTHLY
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents an input GUI for recurring events/appointments (course events or calendar appoi...
setShowMinutes($a_showminutes)
Set Show Minutes.
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
static getGroupSelectOptions($a_user_id)
Get group selection options.
This class represents a number property in a property form.
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static initDomEvent()
Init YUI DomEvent.
setOptions($a_options)
Set Options.
setSize($a_size)
Set Size.
This class represents a text area property in a property form.
setEnabledSubForms($a_sub_forms)
set enabled subforms
const IL_CAL_FREQ_WEEKLY
setShowTime($a_showtime)
Set Show Time Information.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGroupForm()

ilConsultationHoursGUI::initGroupForm (   $a_group_id = 0)
protected

Init new/update group form.

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

References $form, $GLOBALS, and $title.

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

500  {
501  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
502  $group = new ilConsultationHourGroup($a_group_id);
503 
504  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
505  $form = new ilPropertyFormGUI();
506  $form->setFormAction($GLOBALS['DIC']['ilCtrl']->getFormAction($this));
507 
508  if ($a_group_id) {
509  $form->setTitle($GLOBALS['DIC']['lng']->txt('cal_ch_grp_update_tbl'));
510  $form->addCommandButton('updateGroup', $GLOBALS['DIC']['lng']->txt('save'));
511  $form->addCommandButton('groupList', $GLOBALS['DIC']['lng']->txt('cancel'));
512  } else {
513  $form->setTitle($GLOBALS['DIC']['lng']->txt('cal_ch_grp_add_tbl'));
514  $form->addCommandButton('saveGroup', $GLOBALS['DIC']['lng']->txt('save'));
515  $form->addCommandButton('appointmentList', $GLOBALS['DIC']['lng']->txt('cancel'));
516  }
517 
518  $title = new ilTextInputGUI($GLOBALS['DIC']['lng']->txt('title'), 'title');
519  $title->setMaxLength(128);
520  $title->setSize(40);
521  $title->setRequired(true);
522  $title->setValue($group->getTitle());
523  $form->addItem($title);
524 
525  $multiple = new ilNumberInputGUI($GLOBALS['DIC']['lng']->txt('cal_ch_grp_multiple'), 'multiple');
526  $multiple->setRequired(true);
527  $multiple->setMinValue(1);
528  $multiple->setSize(1);
529  $multiple->setMaxLength(2);
530  $multiple->setInfo($GLOBALS['DIC']['lng']->txt('cal_ch_grp_multiple_info'));
531  $multiple->setValue($group->getMaxAssignments());
532  $form->addItem($multiple);
533 
534  return $form;
535  }
This class represents a property form user interface.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
This class represents a text property in a property form.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilConsultationHoursGUI::initSettingsForm ( )
protected

build settings form

Returns
object

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

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

Referenced by settings(), and updateSettings().

1315  {
1316  global $DIC;
1317 
1318  $ilDB = $DIC['ilDB'];
1319  $ilUser = $DIC['ilUser'];
1320 
1321  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1322 
1323  $form = new ilPropertyFormGUI();
1324  $form->setFormAction($this->ctrl->getFormAction($this));
1325 
1326  $mng = new ilTextInputGUI($this->lng->txt('cal_ch_manager'), 'mng');
1327  $mng->setInfo($this->lng->txt('cal_ch_manager_info'));
1328  $form->addItem($mng);
1329 
1330  $mng->setValue(ilConsultationHourAppointments::getManager(true));
1331 
1332  $form->setTitle($this->lng->txt('settings'));
1333  $form->addCommandButton('updateSettings', $this->lng->txt('save'));
1334  // $form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
1335  return $form;
1336  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
global $ilDB
static getManager($a_as_name=false, $a_full_name=false, $a_user_id=null)
Get consultation hour manager for current user or specific user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rejectBooking()

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

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

References $DIC, $ilCtrl, and ilConsultationHourUtils\cancelBooking().

Referenced by deleteBooking().

634  {
635  global $DIC;
636 
637  $ilCtrl = $DIC['ilCtrl'];
638 
639  foreach ((array) $_REQUEST['bookuser'] as $bookuser) {
640  $ids = explode('_', $bookuser);
641 
642  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
643  ilConsultationHourUtils::cancelBooking($ids[1], $ids[0], $a_send_notification);
644  }
645  if ($a_send_notification) {
646  ilUtil::sendSuccess($this->lng->txt('cal_ch_canceled_bookings'), true);
647  } else {
648  ilUtil::sendSuccess($this->lng->txt('cal_ch_deleted_bookings'), true);
649  }
650  $ilCtrl->redirect($this, 'bookingList');
651  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static cancelBooking($a_usr_id, $a_app_id, $a_send_notification=true)
Cancel a booking.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewriteBookingIdsForAppointments()

ilConsultationHoursGUI::rewriteBookingIdsForAppointments ( \ilBookingEntry  $booking,
  $appointments,
\ilPropertyFormGUI  $form 
)
protected
Parameters
ilBookingEntry$booking
int[]$appointments

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

References ilConsultationHourUtils\findCalendarAppointmentsForBooking(), ilBookingEntry\getId(), ilPropertyFormGUI\getInput(), and ilBookingEntry\getInstanceByCalendarEntryId().

Referenced by updateMulti().

1105  {
1106  foreach ($appointments as $appointment_id) {
1107 
1108  $booking_appointment = new \ilCalendarEntry($appointment_id);
1109  $booking_start = $booking_appointment->getStart();
1110  $booking_end = $booking_appointment->getEnd();
1111 
1112  $deprecatedBooking = \ilBookingEntry::getInstanceByCalendarEntryId($appointment_id);
1113  if (!$deprecatedBooking instanceof \ilBookingEntry) {
1114  // @todo error handling
1115  continue;
1116  }
1117 
1119  $deprecatedBooking,
1120  $booking_start,
1121  $booking_end
1122  );
1123  foreach ($relevant_appointments as $relevant_appointment_id) {
1124 
1125  $entry = new \ilCalendarEntry($relevant_appointment_id);
1126  $entry->setContextId($booking->getId());
1127  $entry->setTitle($form->getInput('ti'));
1128  $entry->setLocation($form->getInput('lo'));
1129  $entry->setDescription($form->getInput('de'));
1130  $entry->update();
1131  }
1132  }
1133  }
static findCalendarAppointmentsForBooking(\ilBookingEntry $booking, \ilDateTime $start, \ilDateTime $end)
Booking definition.
static getInstanceByCalendarEntryId($a_id)
Get instance by calendar entry.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGroup()

ilConsultationHoursGUI::saveGroup ( )
protected

Save new group.

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

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

368  {
369  $form = $this->initGroupForm();
370  if ($form->checkInput()) {
371  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
372  $group = new ilConsultationHourGroup();
373  $group->setTitle($form->getInput('title'));
374  $group->setMaxAssignments($form->getInput('multiple'));
375  $group->setUserId($this->getUserId());
376  $group->save();
377 
378  ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('settings_saved'), true);
379  $GLOBALS['DIC']['ilCtrl']->redirect($this, 'groupList');
380  }
381 
382  ilUtil::sendFailure($GLOBALS['DIC']['lng']->txt('err_check_input'), true);
383  $this->addGroup($form);
384  }
initGroupForm($a_group_id=0)
Init new/update group form.
if(isset($_POST['submit'])) $form
addGroup(ilPropertyFormGUI $form=null)
Show add group form type $ilToolbar type $ilTabs.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ saveSequence()

ilConsultationHoursGUI::saveSequence ( )
protected

Save new sequence.

Returns

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

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

829  {
830  global $DIC;
831 
832  $ilObjDataCache = $DIC['ilObjDataCache'];
833 
834  $this->initFormSequence(self::MODE_CREATE);
835 
836  if ($this->form->checkInput()) {
837  $this->form->setValuesByPost();
838 
839  $booking = new ilBookingEntry();
840  $booking->setObjId($this->getUserId());
841  $booking->setNumberOfBookings($this->form->getInput('bo'));
842 
843  $deadline = $this->form->getInput('dead');
844  $deadline = $deadline['dd'] * 24 + $deadline['hh'];
845  $booking->setDeadlineHours($deadline);
846 
847  // consultation hour group
848  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
850  $booking->setBookingGroup((int) $this->form->getInput('grp'));
851  }
852 
853  $tgt = explode(',', $this->form->getInput('tgt'));
854  $obj_ids = array();
855  foreach ((array) $tgt as $ref_id) {
856  if (!trim($ref_id)) {
857  continue;
858  }
859  $obj_id = $ilObjDataCache->lookupObjId($ref_id);
860  $type = ilObject::_lookupType($obj_id);
861  $valid_types = array('crs','grp');
862  if (!$obj_id or !in_array($type, $valid_types)) {
863  ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_repository_object'));
864  $this->tpl->setContent($this->form->getHTML());
865  return;
866  }
867 
868  $obj_ids[] = $obj_id;
869  }
870  $booking->setTargetObjIds($obj_ids);
871 
872  $booking->save();
874 
875  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
876  $this->ctrl->redirect($this, 'appointmentList');
877  } else {
878  $this->form->setValuesByPost();
879  $this->tpl->setContent($this->form->getHTML());
880  }
881  }
$type
global $DIC
Definition: saml.php:7
Booking definition.
createAppointments(ilBookingEntry $booking)
Create calendar appointments.
static getGroupsOfUser($a_user_id)
Get a all groups of an user.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ searchUsersForAppointments()

ilConsultationHoursGUI::searchUsersForAppointments ( )
protected

start searching for users

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

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

165  {
166  global $DIC;
167 
168  $ilCtrl = $DIC['ilCtrl'];
169  $ilTabs = $DIC['ilTabs'];
170 
171  $_SESSION['ch_apps'] = $_REQUEST['apps'];
172 
173  if (empty($_SESSION['ch_apps'])) {
174  ilUtil::sendFailure($this->lng->txt('select_one'), true);
175  $GLOBALS['DIC']['ilCtrl']->redirect($this, 'appointmentList');
176  }
177  $_REQUEST['assignM'] = 1;
178  $ilCtrl->setCmdClass('ilrepositorysearchgui');
179  $ilCtrl->setcmd('');
180  $this->executeCommand();
181  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ sendInfoAboutUnassignedUsers()

ilConsultationHoursGUI::sendInfoAboutUnassignedUsers (   $unassigned)
protected

Send info message about unassigned users.

Parameters
array$unassigned

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

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

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

188  {
189  if (!$unassigned) {
190  return true;
191  }
192  $users = array();
193  foreach ($unassigned as $user_id) {
194  include_once './Services/User/classes/class.ilObjUser.php';
195  $users[] = ilObjUser::_lookupFullname($user_id);
196  }
197  ilUtil::sendInfo($this->lng->txt('cal_ch_user_assignment_failed_info') . '<br />' . implode('<br />', $users), true);
198  return true;
199  }
static _lookupFullname($a_user_id)
Lookup Full Name.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$users
Definition: authpage.php:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilConsultationHoursGUI::setSubTabs ( )
protected

Set sub tabs type $ilTabs type $ilCtrl.

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

References $DIC, $ilCtrl, and getUserId().

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

990  {
991  global $DIC;
992 
993  $ilTabs = $DIC['ilTabs'];
994  $ilCtrl = $DIC['ilCtrl'];
995 
996  $ilCtrl->setParameter($this, 'user_id', $this->getUserId());
997  $ilTabs->addSubTab('cal_ch_app_list', $this->lng->txt('cal_ch_app_list'), $ilCtrl->getLinkTarget($this, 'appointmentList'));
998  $ilTabs->addSubTab('cal_ch_app_grp', $this->lng->txt('cal_ch_app_grp'), $ilCtrl->getLinkTarget($this, 'groupList'));
999  $ilTabs->addSubTab('cal_ch_app_bookings', $this->lng->txt('cal_ch_app_bookings'), $ilCtrl->getLinkTarget($this, 'bookingList'));
1000  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilConsultationHoursGUI::setTabs ( )
protected

Set tabs.

Returns

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

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

Referenced by executeCommand().

963  {
964  global $DIC;
965 
966  $ilTabs = $DIC['ilTabs'];
967  $ilUser = $DIC['ilUser'];
968  $ilCtrl = $DIC['ilCtrl'];
969 
970  $ilCtrl->setParameter($this, 'user_id', '');
971  $ilTabs->addTab('consultation_hours_' . $ilUser->getId(), $this->lng->txt('cal_ch_ch'), $this->ctrl->getLinkTarget($this, 'appointmentList'));
972 
974  $ilCtrl->setParameter($this, 'user_id', $user_id);
975  $ilTabs->addTab('consultation_hours_' . $user_id, $this->lng->txt('cal_ch_ch') . ': ' . $login, $this->ctrl->getLinkTarget($this, 'appointmentList'));
976  }
977  $ilCtrl->setParameter($this, 'user_id', '');
978 
979  $ilTabs->addTab('ch_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'settings'));
980 
981  $ilTabs->activateTab('consultation_hours_' . $this->getUserId());
982  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static getManagedUsers()
Get all managed consultation hours users for current users.
$ilUser
Definition: imgupload.php:18
$login
Definition: cron.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

ilConsultationHoursGUI::settings ( )

display settings gui

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

References $DIC, $form, $tpl, and initSettingsForm().

1296  {
1297  global $DIC;
1298 
1299  $tpl = $DIC['tpl'];
1300  $ilTabs = $DIC['ilTabs'];
1301  $ilHelp = $DIC['ilHelp'];
1302 
1303  $ilHelp->setScreenId("consultation_hours_settings");
1304  $ilTabs->activateTab('ch_settings');
1305 
1306  $form = $this->initSettingsForm();
1307  $tpl->setContent($form->getHTML());
1308  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ showProfile()

ilConsultationHoursGUI::showProfile ( )

show public profile of given user

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

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

1253  {
1254  global $DIC;
1255 
1256  $tpl = $DIC['tpl'];
1257  $ilTabs = $DIC['ilTabs'];
1258  $ilCtrl = $DIC['ilCtrl'];
1259 
1260  $ilTabs->clearTargets();
1261 
1262  $user_id = (int) $_GET['user'];
1263 
1264  include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
1265  $profile = new ilPublicUserProfileGUI($user_id);
1266  $profile->setBackUrl($this->getProfileBackUrl());
1267  $tpl->setContent($ilCtrl->getHTML($profile));
1268  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
GUI class for public user profile presentation.
getProfileBackUrl()
Build context-sensitive profile back url.
+ Here is the call graph for this function:

◆ updateGroup()

ilConsultationHoursGUI::updateGroup ( )
protected

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

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

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

416  {
417  global $DIC;
418 
419  $ilCtrl = $DIC['ilCtrl'];
420  $tpl = $DIC['tpl'];
421  $ilTabs = $DIC['ilTabs'];
422 
423  $ilCtrl->setParameter($this, 'grp_id', (int) $_REQUEST['grp_id']);
424 
425  $form = $this->initGroupForm((int) $_REQUEST['grp_id']);
426  if ($form->checkInput()) {
427  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
428  $group = new ilConsultationHourGroup((int) $_REQUEST['grp_id']);
429  $group->setTitle($form->getInput('title'));
430  $group->setMaxAssignments($form->getInput('multiple'));
431  $group->setUserId($this->getUserId());
432  $group->update();
433 
434  ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('settings_saved'), true);
435  $GLOBALS['DIC']['ilCtrl']->redirect($this, 'groupList');
436  }
437 
438  ilUtil::sendFailure($GLOBALS['DIC']['lng']->txt('err_check_input'), true);
439  $this->editGroup($form);
440  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
initGroupForm($a_group_id=0)
Init new/update group form.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
editGroup(ilPropertyFormGUI $form=null)
Edit group type $ilCtrl.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ updateMulti()

ilConsultationHoursGUI::updateMulti ( )
protected

Update multiple sequence items.

Returns

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

References $_POST, $booking, $DIC, createNewBookingEntry(), edit(), initFormSequence(), ilBookingEntry\removeObsoleteEntries(), and rewriteBookingIdsForAppointments().

1140  {
1141  global $DIC;
1142 
1143  $ilObjDataCache = $DIC['ilObjDataCache'];
1144 
1145  $this->initFormSequence(self::MODE_MULTI);
1146 
1147  if ($this->form->checkInput()) {
1148 
1149  $this->form->setValuesByPost();
1150  $apps = explode(';', (string) $_POST['apps']);
1151 
1152  // create new booking
1153  $booking = $this->createNewBookingEntry($this->form);
1154  if (!$booking instanceof \ilBookingEntry) {
1155  $this->edit();
1156  return false;
1157  }
1158  $this->rewriteBookingIdsForAppointments($booking, $apps, $this->form);
1160 
1161  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1162  $this->ctrl->redirect($this, 'appointmentList');
1163  }
1164  $this->tpl->setContent($this->form->getHTML());
1165  }
global $DIC
Definition: saml.php:7
edit()
Edit multiple sequence items.
static removeObsoleteEntries()
Remove unused booking entries.
Booking definition.
rewriteBookingIdsForAppointments(\ilBookingEntry $booking, $appointments, \ilPropertyFormGUI $form)
createNewBookingEntry(\ilPropertyFormGUI $validate_form)
$_POST["username"]
+ Here is the call graph for this function:

◆ updateSettings()

ilConsultationHoursGUI::updateSettings ( )

save settings

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

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

1342  {
1343  global $DIC;
1344 
1345  $ilDB = $DIC['ilDB'];
1346  $ilCtrl = $DIC['ilCtrl'];
1347  $ilUser = $DIC['ilUser'];
1348  $tpl = $DIC['tpl'];
1349  $ilTabs = $DIC['ilTabs'];
1350 
1351  $form = $this->initSettingsForm();
1352  if ($form->checkInput()) {
1353  $mng = $form->getInput('mng');
1355  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1356  $ilCtrl->redirect($this, 'settings');
1357  } else {
1358  $ilTabs->activateTab('ch_settings');
1359 
1360  ilUtil::sendFailure($this->lng->txt('cal_ch_unknown_user'));
1361  $field = $form->getItemByPostVar('mng');
1362  $field->setValue($mng);
1363  $tpl->setContent($form->getHTML());
1364  return;
1365  }
1366  }
1367  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static setManager($a_user_name)
Set consultation hour manager for current user.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $booking

ilConsultationHoursGUI::$booking = null
protected

◆ $ctrl

ilConsultationHoursGUI::$ctrl
protected

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

◆ $user_id

ilConsultationHoursGUI::$user_id
protected

◆ MAX_APPOINTMENTS_PER_SEQUENCE

const ilConsultationHoursGUI::MAX_APPOINTMENTS_PER_SEQUENCE = 1000

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

◆ MODE_CREATE

const ilConsultationHoursGUI::MODE_CREATE = 1

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

◆ MODE_MULTI

const ilConsultationHoursGUI::MODE_MULTI = 3

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

◆ MODE_UPDATE

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: