2 include_once
'./Services/Calendar/interfaces/interface.ilCalendarAppointmentPresentation.php';
3 include_once
'./Services/Calendar/classes/class.ilCalendarViewGUI.php';
98 public function __construct($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
101 $this->appointment = $a_appointment;
102 $this->infoscreen = $a_info_screen;
103 $this->toolbar = $a_toolbar;
104 $this->lng = $DIC->language();
105 $this->lng->loadLanguageModule(
"dateplaner");
106 $this->tree = $DIC->repositoryTree();
107 $this->ui = $DIC->ui();
108 $this->list_item = $a_list_item;
109 $this->ctrl = $DIC->ctrl();
110 $this->access = $DIC->access();
111 $this->rbacsystem = $DIC->rbac()->system();
112 $this->
user = $DIC->user();
130 $cat_id = $this->
getCatId($this->appointment[
'event']->getEntryId());
132 $this->obj_id = $category->getObjId();
140 public static function getInstance($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
142 return new static($a_appointment, $a_info_screen, $a_toolbar, $a_list_item);
182 $cat_id = $this->
getCatId($this->appointment[
'event']->getEntryId());
192 $next_class =
$ilCtrl->getNextClass();
193 $cmd =
$ilCtrl->getCmd(
"getHTML");
195 switch ($next_class) {
197 return $this->$cmd();
212 foreach ($this->info_items as
$i) {
213 switch ($i[
"type"]) {
230 $this->ctrl->setParameter($this,
"app_id", $this->appointment[
'event']->getEntryId());
233 $download_btn->setCaption($this->lng->txt(
"cal_download_files"),
false);
234 $download_btn->setUrl(
235 $this->ctrl->getLinkTarget($this,
'downloadFiles')
237 $this->ctrl->setParameter($this,
"app_id",
$_GET[
"app_id"]);
239 $toolbar->addButtonInstance($download_btn);
243 foreach ($this->actions as $a) {
245 $btn->setCaption($a[
"txt"],
false);
246 $btn->setUrl($a[
"link"]);
260 $label = $dd->getLabel();
264 foreach ($this->actions as $a) {
265 $actions[] =
$ui->factory()->button()->shy($a[
"txt"], $a[
"link"]);
267 foreach ($this->list_properties as $lp) {
268 $properties[$lp[
"txt"]] = $lp[
"val"];
271 $new_dd =
$ui->factory()->dropdown()->standard(
$actions)
273 $this->list_item =
$list_item->withActions($new_dd)->withProperties($properties);
285 $ref_id = current($refs);
286 if (count($refs) == 1 && $ref_id > 0) {
288 $f = $this->ui->factory();
289 $r = $this->ui->renderer();
292 $cont_ref_id =
$tree->checkForParentType($ref_id,
'grp');
293 if ($cont_ref_id == 0) {
294 $cont_ref_id =
$tree->checkForParentType($ref_id,
'crs');
297 if ($cont_ref_id > 0) {
314 $this->info_items[] = array(
"type" =>
"section",
"txt" => $a_txt);
325 $this->info_items[] = array(
"type" =>
"property",
"txt" => $a_txt,
"val" => $a_val);
337 $this->list_properties[] = array(
"txt" => $a_txt,
"val" => $a_val);
348 $this->actions[] = array(
"txt" => $a_txt,
"link" => $a_link);
367 if ($cat_info[
'editable']
and !$this->appointment[
'event']->isAutoGenerated()) {
368 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
370 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $this->appointment[
'event']->getEntryId());
371 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'dt', $this->appointment[
'dstart']);
374 $this->lng->txt(
"edit"),
375 $this->ctrl->getLinkTargetByClass(array(
'ilcalendarappointmentgui'),
'askEdit')
378 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
380 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $this->appointment[
'event']->getEntryId());
381 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'dt', $this->appointment[
'dstart']);
384 $this->lng->txt(
"delete"),
385 $this->ctrl->getLinkTargetByClass(array(
'ilcalendarappointmentgui'),
'askDelete')
402 foreach ($refs as $ref_id) {
404 if (count($refs) > 1) {
405 $par_ref = $this->tree->getParentId($ref_id);
411 $buttons[] = $this->ui->renderer()->render(
412 $this->ui->factory()->button()->shy($link_title, $link)
418 $prop_value = implode(
"<br>", $buttons);
420 if ($prop_value !=
'') {
445 if (!isset($this->readable_ref_ids[$a_obj_id])) {
448 if ($this->access->checkAccess(
"read",
"", $ref_id)) {
449 $ref_ids[] = $ref_id;
452 $this->readable_ref_ids[$a_obj_id] = $ref_ids;
454 return $this->readable_ref_ids[$a_obj_id];
464 if ($a_app[
'event']->getDescription()) {
476 if ($a_app[
'event']->getLocation()) {
477 $this->
addInfoProperty($this->lng->txt(
"cal_where"), $a_app[
'event']->getLocation());
500 $this->ctrl->setParameterByClass(
"ilCalendarPresentationGUI",
"category_id", $cat_info[
"cat_id"]);
502 $link = $this->ui->renderer()->render(
503 $this->ui->factory()->button()->shy(
505 $this->ctrl->getLinkTargetByClass(array(
"ilPersonalDesktopGUI",
"ilCalendarPresentationGUI"),
"")
509 $this->ctrl->setParameterByClass(
"ilCalendarPresentationGUI",
"category_id",
$_GET[
"category_id"]);
521 public function addCommonSection($a_app, $a_obj_id = 0, $cat_info = null, $a_container_info =
false)
524 $this->
addInfoSection($a_app[
"event"]->getPresentationTitle(
false));
535 if ($a_container_info) {
543 if ($cat_info != null) {
551 public function addMetaData($a_obj_type, $a_obj_id, $a_sub_obj_type = null, $a_sub_obj_id = null)
554 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
562 $md_items = $record_gui->parse();
563 if (count($md_items)) {
564 foreach ($md_items as $md_item) {
580 $ctrl_path = array();
581 if (
$type ==
"crs") {
582 $ctrl_path[] =
"ilobjcoursegui";
584 if (
$type ==
"grp") {
585 $ctrl_path[] =
"ilobjgroupgui";
587 if (strtolower($_GET[
"baseClass"]) ==
"ilpersonaldesktopgui") {
588 $ctrl_path[] =
"ilpersonaldesktopgui";
590 $ctrl_path[] =
"ilCalendarPresentationGUI";
591 $ctrl_path[] =
"ilpublicuserprofilegui";
597 $this->ctrl->getParentReturn($this),
615 $entry_id = (int)
$_GET[
'app_id'];
618 if ($entry->getStart()) {
621 "dstart" => $entry->getStart(),
622 "dend" => $entry->getEnd(),
623 "fullday" => $entry->isFullday()
627 $this->ctrl->returnToParent($this);
631 include_once
'./Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';
636 if ($download_job->run()) {
637 ilUtil::sendSuccess($this->lng->txt(
'cal_download_files_started'),
true);
639 $this->ctrl->returnToParent($this);
addInfoProperty($a_txt, $a_val)
Add info property.
readObjIdForAppointment()
read obj_id for appointment
collectPropertiesAndActions()
Collect properties and actions.
static _lookupCategory($a_cal_id)
Lookup category id.
Model for a calendar entry.
static _getInstance()
get singleton instance
const MODE_APP_PRESENTATION
getUserName($a_user_id, $a_force_name=false)
Get (linked if possible) user name.
getReadableRefIds($a_obj_id)
Get readable ref ids.
buildDirectLinkForAppointment($a_ref_id, $a_appointment=null)
Build direct link for appointment.
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
addEventDescription($a_app)
Add event description.
static _lookupTitle($a_id)
lookup object title
addEventLocation($a_app)
Add event location.
addCalendarInfo($cat_info)
Add calendar info.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Description of class class.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
addCommonSection($a_app, $a_obj_id=0, $cat_info=null, $a_container_info=false)
Add common section.
downloadFiles()
Download files from an appointment ( Modals )
static _lookupObjId($a_id)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
addLastUpdate($a_app)
Add last update.
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
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:
static _getInstance($a_usr_id=0)
get singleton instance
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
addMetaData($a_obj_type, $a_obj_id, $a_sub_obj_type=null, $a_sub_obj_id=null)
Add metadata.
addListItemProperty($a_txt, $a_val)
Add list item property.
addObjectLinks($obj_id, $a_appointment=null)
Add object link.
getListItem()
Get list item.
__construct($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
addAction($a_txt, $a_link)
Add action.
collectStandardPropertiesAndActions()
Collect standard properties and actions.
static getInstance($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
addContainerInfo($a_obj_id)
Add course/group container info.
addInfoSection($a_txt)
Add info section.
setBucketTitle($a_title)
set bucket title.