24 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
45 public function __construct($a_parent_obj, $a_parent_cmd, $a_category_id)
51 $this->cat_id = $a_category_id;
52 $this->is_editable = $this->categories->isEditable($this->cat_id);
55 $this->lng->loadLanguageModule(
'dateplaner');
58 $this->
setId(
'calcalapps');
60 parent::__construct($a_parent_obj, $a_parent_cmd);
63 $this->
addColumn($this->lng->txt(
'cal_start'),
'dt_sort',
"30%");
64 $this->
addColumn($this->lng->txt(
'title'),
'title',
"60%");
65 $this->
addColumn($this->lng->txt(
'cal_duration'),
'duration',
"20%");
66 $this->
addColumn($this->lng->txt(
'cal_recurrences'),
'frequence',
"10%");
68 if ($this->is_editable) {
69 $this->
addMultiCommand(
'askDeleteAppointments', $this->lng->txt(
'delete'));
70 $this->
enable(
'select_all');
75 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
76 $this->
setRowTemplate(
"tpl.show_appointment_row.html",
"Services/Calendar");
97 if ($a_set[
'deletable']) {
98 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
101 $this->tpl->setVariable(
'VAL_DESCRIPTION', $a_set[
'description']);
103 $this->tpl->setVariable(
'VAL_TITLE_LINK', $a_set[
'title']);
104 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id', $a_set[
'id']);
105 $this->tpl->setVariable(
'VAL_LINK', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
107 switch ($a_set[
'frequence']) {
109 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->lng->txt(
'cal_daily'));
113 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->lng->txt(
'cal_weekly'));
117 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->lng->txt(
'cal_monthly'));
121 $this->tpl->setVariable(
'VAL_FREQUENCE', $this->lng->txt(
'cal_yearly'));
126 $this->tpl->setVariable(
'VAL_FREQUENCE',
'');
129 $this->tpl->setVariable(
'VAL_BEGIN', $a_set[
'dt']);
130 if ($a_set[
'duration']) {
133 $this->tpl->setVariable(
'VAL_DURATION',
'');
154 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
155 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
156 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
160 foreach ($a_apps as $cal_entry_id) {
166 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
169 $title = $entry->getTitle();
170 if ($book->isOwner()) {
171 $max = (int) $book->getNumberOfBookings();
172 $current = (int) $book->getCurrentNumberOfBookings($entry->getEntryId());
176 $title .=
' (' . $this->lng->txt(
'cal_booked_out') .
')';
178 $title .=
' (' . $this->lng->txt(
'cal_book_free') .
')';
180 } elseif ($book->hasBooked($entry->getEntryId())) {
181 $title .=
' (' . $this->lng->txt(
'cal_date_booked') .
')';
185 $title = $entry->getPresentationTitle();
188 $tmp_arr[
'id'] = $entry->getEntryId();
189 $tmp_arr[
'title'] =
$title;
190 $tmp_arr[
'description'] = $entry->getDescription();
191 $tmp_arr[
'fullday'] = $entry->isFullday();
192 $tmp_arr[
'begin'] = $entry->getStart()->get(
IL_CAL_UNIX);
193 $tmp_arr[
'end'] = $entry->getEnd()->get(
IL_CAL_UNIX);
195 $tmp_arr[
'dt_sort'] = $entry->getStart()->get(
IL_CAL_UNIX);
201 #$tmp_arr['duration'] = ($dur = $tmp_arr['end'] - $tmp_arr['begin']) ? $dur : 60 * 60 * 24; 202 $tmp_arr[
'duration'] = $tmp_arr[
'end'] - $tmp_arr[
'begin'];
203 if ($tmp_arr[
'fullday']) {
204 $tmp_arr[
'duration'] += (60 * 60 * 24);
207 if (!$tmp_arr[
'fullday'] and $tmp_arr[
'end'] == $tmp_arr[
'begin']) {
208 $tmp_arr[
'duration'] =
'';
210 $tmp_arr[
'frequence'] = $rec->getFrequenceType();
213 $appointments[] = $tmp_arr;
215 $this->
setData($appointments ? $appointments :
array());
const IL_CAL_FREQ_MONTHLY
Model for a calendar entry.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static _getFirstRecurrence($a_cal_id)
get first recurrence
Stores calendar categories.
setAppointments($a_apps)
set appointments
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
static _getInstance($a_usr_id=0)
get singleton instance
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
__construct($a_parent_obj, $a_parent_cmd, $a_category_id)
Constructor.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.