24include_once 
'./Services/Calendar/classes/class.ilCalendarSettings.php';
 
   78        if (isset(self::$instance) and self::$instance) {
 
  110        $this->tpl = 
new ilTemplate(
'tpl.appointment_panel.html', 
true, 
true, 
'Services/Calendar');
 
  113        $this->tpl->setVariable(
'PANEL_NUM', self::$counter);
 
  114        $this->tpl->setVariable(
'PANEL_TITLE', str_replace(
' ()', 
'', $a_app[
'event']->getPresentationTitle(
false)));
 
  115        if ($a_app[
"event"]->isMilestone()) {
 
  116            $this->tpl->setVariable(
'PANEL_DETAILS', $this->lng->txt(
'cal_ms_details'));
 
  118            $this->tpl->setVariable(
'PANEL_DETAILS', $this->lng->txt(
'cal_details'));
 
  120        $this->tpl->setVariable(
'PANEL_TXT_DATE', $this->lng->txt(
'date'));
 
  122        if ($a_app[
'fullday']) {
 
  133        if ($a_app[
'event']->getLocation()) {
 
  134            $this->tpl->setVariable(
'PANEL_TXT_WHERE', $this->lng->txt(
'cal_where'));
 
  138            $this->tpl->setVariable(
'PANEL_TXT_DESC', $this->lng->txt(
'description'));
 
  142        if ($a_app[
'event']->isMilestone() && $a_app[
'event']->getCompletion() > 0) {
 
  143            $this->tpl->setVariable(
'PANEL_TXT_COMPL', $this->lng->txt(
'cal_task_completion'));
 
  144            $this->tpl->setVariable(
'PANEL_COMPL', $a_app[
'event']->getCompletion() . 
" %");
 
  147        if ($a_app[
'event']->isMilestone()) {
 
  149            $users = $a_app[
'event']->readResponsibleUsers();
 
  152                $value .= $delim . 
$r[
"lastname"] . 
", " . 
$r[
"firstname"] . 
" [" . 
$r[
"login"] . 
"]";
 
  156                $this->tpl->setVariable(
'PANEL_TXT_RESP', $this->lng->txt(
'cal_responsible'));
 
  157                $this->tpl->setVariable(
'PANEL_RESP', $value);
 
  161        include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
 
  164        $entry_obj_id = isset($cat_info[
'subitem_obj_ids'][$cat_id]) ?
 
  165            $cat_info[
'subitem_obj_ids'][$cat_id] :
 
  168        $this->tpl->setVariable(
'PANEL_TXT_CAL_TYPE', $this->lng->txt(
'cal_cal_type'));
 
  169        switch ($cat_info[
'type']) {
 
  171                $this->tpl->setVariable(
'PANEL_CAL_TYPE', $this->lng->txt(
'cal_type_system'));
 
  175                $this->tpl->setVariable(
'PANEL_CAL_TYPE', $this->lng->txt(
'cal_type_personal'));
 
  180                $this->tpl->setVariable(
'PANEL_CAL_TYPE', $this->lng->txt(
'cal_type_' . 
$type));
 
  183                if ($this->
settings->isCGRegistrationEnabled() and 
$type == 
'crs' or 
$type == 
'grp') {
 
  184                    if (!$a_app[
'event']->isAutoGenerated()) {
 
  185                        include_once 
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
 
  189                            $this->tpl->setCurrentBlock(
'panel_cancel_book_link');
 
  190                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  191                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $a_app[
'event']->getEntryId());
 
  192                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dstart', $a_app[
'dstart']);
 
  193                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dend', $a_app[
'dend']);
 
  195                            $this->tpl->setVariable(
'TXT_PANEL_CANCELBOOK', $this->lng->txt(
'cal_reg_unregister'));
 
  196                            $this->tpl->setVariable(
'PANEL_CANCELBOOK_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'confirmUnregister'));
 
  197                            $this->tpl->parseCurrentBlock();
 
  199                            $this->tpl->setCurrentBlock(
'panel_book_link');
 
  200                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  201                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $a_app[
'event']->getEntryId());
 
  202                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dstart', $a_app[
'dstart']);
 
  203                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dend', $a_app[
'dend']);
 
  204                            $this->tpl->setVariable(
'TXT_PANEL_BOOK', $this->lng->txt(
'cal_reg_register'));
 
  205                            $this->tpl->setVariable(
'PANEL_BOOK_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'confirmRegister'));
 
  206                            $this->tpl->parseCurrentBlock();
 
  209                        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  210                        $registrations = array();
 
  213                            $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'user', $usr_id);
 
  214                            $registrations[] = 
'<a href="' . $this->ctrl->getLinkTargetByClass(
'ilconsultationhoursgui', 
'showprofile') . 
'">' . 
ilObjUser::_lookupFullname($usr_id);
 
  215                            $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'user', 
'');
 
  217                        if (count($registrations)) {
 
  218                            $this->tpl->setCurrentBlock(
'panel_current_booking');
 
  219                            $this->tpl->setVariable(
'PANEL_TXT_CURRENT_BOOKING', $this->lng->txt(
'cal_reg_registered_users'));
 
  220                            $this->tpl->setVariable(
'PANEL_CURRENT_BOOKING', implode(
'<br />', $registrations));
 
  221                            $this->tpl->parseCurrentBlock();
 
  228                $this->tpl->setVariable(
'PANEL_CAL_TYPE', $this->lng->txt(
'cal_ch_ch'));
 
  230                include_once 
'Services/Booking/classes/class.ilBookingEntry.php';
 
  233                $is_owner = $entry->isOwner();
 
  234                $user_entry = ($cat_info[
'obj_id'] == 
$ilUser->getId());
 
  236                if ($user_entry && !$is_owner) {
 
  238                    include_once 
'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
 
  240                    $ref_event = $apps[0];
 
  242                    $ref_event = $a_app[
'event']->getEntryId();
 
  245                $this->tpl->setCurrentBlock(
'panel_booking_owner');
 
  246                $this->tpl->setVariable(
'PANEL_TXT_BOOKING_OWNER', $this->lng->txt(
'cal_ch_booking_owner'));
 
  248                $this->tpl->parseCurrentBlock();
 
  250                $this->tpl->setCurrentBlock(
'panel_max_booking');
 
  251                $this->tpl->setVariable(
'PANEL_TXT_MAX_BOOKING', $this->lng->txt(
'cal_ch_num_bookings'));
 
  252                $this->tpl->setVariable(
'PANEL_MAX_BOOKING', $entry->getNumberOfBookings());
 
  253                $this->tpl->parseCurrentBlock();
 
  256                    if ($entry->hasBooked($ref_event)) {
 
  258                            $this->tpl->setCurrentBlock(
'panel_cancel_book_link');
 
  259                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $ref_event);
 
  260                            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  261                            $this->tpl->setVariable(
'TXT_PANEL_CANCELBOOK', $this->lng->txt(
'cal_ch_cancel_booking'));
 
  262                            $this->tpl->setVariable(
'PANEL_CANCELBOOK_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'cancelBooking'));
 
  263                            $this->tpl->parseCurrentBlock();
 
  266                    #else if(!$entry->isBookedOut($ref_event)) 
  267                    elseif ($entry->isAppointmentBookableForUser($ref_event, 
$GLOBALS[
'DIC'][
'ilUser']->getId())) {
 
  268                        $this->tpl->setCurrentBlock(
'panel_book_link');
 
  269                        $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $ref_event);
 
  270                        $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  271                        $this->tpl->setVariable(
'TXT_PANEL_BOOK', $this->lng->txt(
'cal_ch_book'));
 
  272                        $this->tpl->setVariable(
'PANEL_BOOK_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'book'));
 
  273                        $this->tpl->parseCurrentBlock();
 
  276                    $this->tpl->setCurrentBlock(
'panel_current_booking');
 
  277                    $this->tpl->setVariable(
'PANEL_TXT_CURRENT_BOOKING', $this->lng->txt(
'cal_ch_current_bookings'));
 
  278                    $this->tpl->setVariable(
'PANEL_CURRENT_BOOKING', $entry->getCurrentNumberOfBookings($ref_event));
 
  279                    $this->tpl->parseCurrentBlock();
 
  281                    $obj_ids = $entry->getTargetObjIds();
 
  282                    foreach ($obj_ids as $obj_id) {
 
  285                        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  286                        $this->tpl->setCurrentBlock(
'panel_booking_target_row');
 
  287                        $this->tpl->setVariable(
'PANEL_BOOKING_TARGET_TITLE', 
$title);
 
  288                        $this->tpl->setVariable(
'PANEL_BOOKING_TARGET', 
ilLink::_getLink(end($refs)));
 
  289                        $this->tpl->parseCurrentBlock();
 
  292                        $this->tpl->setCurrentBlock(
'panel_booking_target');
 
  293                        $this->tpl->setVariable(
'PANEL_TXT_BOOKING_TARGET', $this->lng->txt(
'cal_ch_target_object'));
 
  294                        $this->tpl->parseCurrentBlock();
 
  302                    include_once 
'./Services/Link/classes/class.ilLink.php';
 
  304                    $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'panel', 1);
 
  305                    foreach ($entry->getCurrentBookings($a_app[
'event']->getEntryId()) as $user_id) {
 
  307                            $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'user', $user_id);
 
  308                            $bookings[] = 
'<a href="' . $this->ctrl->getLinkTargetByClass(
'ilconsultationhoursgui', 
'showprofile') . 
'">' .
 
  310                            $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'user', 
'');
 
  315                    $this->ctrl->setParameterByClass(
'ilconsultationhoursgui', 
'panel', 
'');
 
  316                    $this->tpl->setCurrentBlock(
'panel_current_booking');
 
  317                    $this->tpl->setVariable(
'PANEL_TXT_CURRENT_BOOKING', $this->lng->txt(
'cal_ch_current_bookings'));
 
  318                    $this->tpl->setVariable(
'PANEL_CURRENT_BOOKING', implode(
'<br />', $bookings));
 
  319                    $this->tpl->parseCurrentBlock();
 
  324                $this->tpl->setVariable(
'PANEL_CAL_TYPE', $this->lng->txt(
'cal_ch_booking'));
 
  326                $this->tpl->setCurrentBlock(
'panel_cancel_book_link');
 
  327                $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $a_app[
'event']->getEntryId());
 
  328                $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  329                $this->tpl->setVariable(
'TXT_PANEL_CANCELBOOK', $this->lng->txt(
'cal_ch_cancel_booking'));
 
  330                $this->tpl->setVariable(
'PANEL_CANCELBOOK_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'cancelBooking'));
 
  331                $this->tpl->parseCurrentBlock();
 
  335        $this->tpl->setVariable(
'PANEL_TXT_CAL_NAME', $this->lng->txt(
'cal_calendar_name'));
 
  336        $this->tpl->setVariable(
'PANEL_CAL_NAME', $cat_info[
'title']);
 
  339        if ($cat_info[
'editable'] and !$a_app[
'event']->isAutoGenerated()) {
 
  340            $this->tpl->setCurrentBlock(
'panel_edit_link');
 
  341            $this->tpl->setVariable(
'TXT_PANEL_EDIT', $this->lng->txt(
'edit'));
 
  343            $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
 
  344            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  345            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $a_app[
'event']->getEntryId());
 
  346            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dt', $a_app[
'dstart']);
 
  347            $this->tpl->setVariable(
'PANEL_EDIT_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'askEdit'));
 
  349            $this->tpl->setCurrentBlock(
'panel_delete_link');
 
  350            $this->tpl->setVariable(
'TXT_PANEL_DELETE', $this->lng->txt(
'delete'));
 
  352            $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
 
  353            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->
getSeed()->
get(
IL_CAL_DATE));
 
  354            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $a_app[
'event']->getEntryId());
 
  355            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'dt', $a_app[
'dstart']);
 
  356            $this->tpl->setVariable(
'PANEL_DELETE_HREF', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'askdelete'));
 
  357            $this->tpl->parseCurrentBlock();
 
  359        include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
 
  367            include_once(
'./Services/Link/classes/class.ilLink.php');
 
  369            $parent = 
$tree->getParentId(current($refs));
 
  371            $this->tpl->setVariable(
'PANEL_TXT_LINK', $this->lng->txt(
'ext_link'));
 
  372            $this->tpl->setVariable(
'PANEL_LINK_HREF', $href);
 
  373            $this->tpl->setVariable(
'PANEL_LINK_NAME', 
$title);
 
  374            $this->tpl->setVariable(
'PANEL_PARENT', $parent_title);
 
  377        return $this->tpl->get();
 
An exception for terminatinating execution or to throw for unit testing.
GUI class for YUI appointment panels.
static _getInstance(ilDate $seed)
get singleton instance
__construct(ilDate $seed=null)
Singleton.
const MODE_PORTFOLIO_CONSULTATION
static _getInstance($a_usr_id=0)
get singleton instance
static _lookupCategory($a_cal_id)
Lookup category id.
registration for calendar appointments
static _getInstance()
get singleton instance
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.