3 declare(strict_types=1);
36 public function __construct(
object $a_parent_obj,
string $a_parent_cmd,
int $a_category_id)
41 $this->cat_id = $a_category_id;
42 $this->is_editable = $this->categories->isEditable($this->cat_id);
44 $this->
setId(
'calcalapps');
47 $this->
lng->loadLanguageModule(
'dateplaner');
51 $this->
addColumn($this->
lng->txt(
'cal_start'),
'dt_sort',
"30%");
52 $this->
addColumn($this->
lng->txt(
'title'),
'title',
"60%");
53 $this->
addColumn($this->
lng->txt(
'cal_duration'),
'duration',
"20%");
54 $this->
addColumn($this->
lng->txt(
'cal_recurrences'),
'frequence',
"10%");
56 if ($this->is_editable) {
58 $this->
enable(
'select_all');
64 $this->
setRowTemplate(
"tpl.show_appointment_row.html",
"Services/Calendar");
75 protected function fillRow(array $a_set): void
77 if ($a_set[
'deletable']) {
78 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
81 $this->tpl->setVariable(
'VAL_DESCRIPTION', $a_set[
'description']);
83 $this->tpl->setVariable(
'VAL_TITLE_LINK', $a_set[
'title']);
84 $this->
ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $a_set[
'id']);
85 $this->tpl->setVariable(
'VAL_LINK', $this->
ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
87 switch ($a_set[
'frequence']) {
89 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->
lng->txt(
'cal_daily'));
93 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->
lng->txt(
'cal_weekly'));
97 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->
lng->txt(
'cal_monthly'));
101 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->
lng->txt(
'cal_yearly'));
106 $this->tpl->setVariable(
'VAL_FREQUENCE',
'');
109 $this->tpl->setVariable(
'VAL_BEGIN', $a_set[
'dt']);
110 if ($a_set[
'duration']) {
113 $this->tpl->setVariable(
'VAL_DURATION',
'');
126 foreach ($a_apps as $cal_entry_id) {
135 $title = $entry->getTitle();
136 if ($book->isOwner()) {
138 $current = $book->getCurrentNumberOfBookings($entry->getEntryId());
140 $title .=
' (' . $current .
'/' . $max .
')';
141 } elseif ($current == $max) {
142 $title .=
' (' . $this->
lng->txt(
'cal_booked_out') .
')';
144 $title .=
' (' . $this->
lng->txt(
'cal_book_free') .
')';
146 } elseif ($book->hasBooked($entry->getEntryId())) {
147 $title .=
' (' . $this->
lng->txt(
'cal_date_booked') .
')';
151 $title = $entry->getPresentationTitle();
154 $tmp_arr[
'id'] = $entry->getEntryId();
155 $tmp_arr[
'title'] =
$title;
156 $tmp_arr[
'description'] = $entry->getDescription();
157 $tmp_arr[
'fullday'] = $entry->isFullday();
158 $tmp_arr[
'begin'] = $entry->getStart()->get(
IL_CAL_UNIX);
159 $tmp_arr[
'end'] = $entry->getEnd()->get(
IL_CAL_UNIX);
161 $tmp_arr[
'dt_sort'] = $entry->getStart()->get(
IL_CAL_UNIX);
167 $tmp_arr[
'duration'] = $tmp_arr[
'end'] - $tmp_arr[
'begin'];
168 if ($tmp_arr[
'fullday']) {
169 $tmp_arr[
'duration'] += (60 * 60 * 24);
172 if (!$tmp_arr[
'fullday'] and $tmp_arr[
'end'] == $tmp_arr[
'begin']) {
173 $tmp_arr[
'duration'] =
'';
175 $tmp_arr[
'frequence'] = $rec->getFrequenceType();
178 $appointments[] = $tmp_arr;
class for calendar categories
ilCalendarCategories $categories
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
static _getFirstRecurrence($a_cal_id)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Stores calendar categories.
setFormName(string $a_name="")
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_category_id)
static _getInstance($a_usr_id=0)
get singleton instance
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
setAppointments(array $a_apps)
set appointments
addMultiCommand(string $a_cmd, string $a_text)