Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

102 changes: 0 additions & 102 deletions components/ILIAS/Calendar/classes/class.ilCalendarCategoryGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ public function executeCommand(): void
}
switch ($next_class) {
case 'ilcalendarappointmentgui':
$this->ctrl->setReturn($this, 'details');

$app_id = 0;
if ($this->http->wrapper()->query()->has('app_id')) {
$app_id = $this->http->wrapper()->query()->retrieve(
Expand All @@ -177,9 +175,6 @@ public function executeCommand(): void
default:
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
if (!in_array($cmd, array("details", "askDeleteAppointments", "deleteAppointments"))) {
return;
}
}
}

Expand Down Expand Up @@ -346,25 +341,6 @@ protected function edit(?ilPropertyFormGUI $form = null): void
$this->tpl->setContent($form->getHTML());
}

protected function details(): void
{
if (!$this->category_id) {
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
$this->ctrl->returnToParent($this);
}

$this->readPermissions();
$this->checkVisible();

// Non editable category
$info = new ilInfoScreenGUI($this);
$info->setFormAction($this->ctrl->getFormAction($this));

$info->addSection($this->lng->txt('cal_cal_details'));

$this->tpl->setContent($info->getHTML() . $this->showAssignedAppointments());
}

protected function synchroniseCalendar(): void
{
if (!$this->category_id) {
Expand Down Expand Up @@ -941,84 +917,6 @@ protected function unshare(): void
$this->ctrl->redirect($this, 'manage');
}

protected function showAssignedAppointments(): string
{
$table_gui = new ilCalendarAppointmentsTableGUI($this, 'details', $this->category_id);
$table_gui->setTitle($this->lng->txt('cal_assigned_appointments'));
$table_gui->setAppointments(
ilCalendarCategoryAssignments::_getAssignedAppointments(
ilCalendarCategories::_getInstance()->getSubitemCategories($this->category_id)
)
);
return $table_gui->getHTML();
}

protected function askDeleteAppointments(): void
{
$appointments = [];
if ($this->http->wrapper()->post()->has('appointments')) {
$appointments = $this->http->wrapper()->post()->retrieve(
'appointments',
$this->refinery->kindlyTo()->dictOf(
$this->refinery->kindlyTo()->int()
)
);
}
if (!count($appointments)) {
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
$this->details();
return;
}
$this->readPermissions();
if (!$this->isEditable() || !$this->areAppointmentsEditable($appointments)) {
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
$this->ctrl->returnToParent($this);
}

$confirmation_gui = new ilConfirmationGUI();
$this->ctrl->setParameter($this, 'category_id', $this->category_id);
$confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
$confirmation_gui->setHeaderText($this->lng->txt('cal_del_app_sure'));
$confirmation_gui->setConfirm($this->lng->txt('delete'), 'deleteAppointments');
$confirmation_gui->setCancel($this->lng->txt('cancel'), 'details');

foreach ($appointments as $app_id) {
$app = new ilCalendarEntry($app_id);
$confirmation_gui->addItem('appointments[]', (string) $app_id, $app->getTitle());
}
$this->tpl->setContent($confirmation_gui->getHTML());
}

protected function deleteAppointments(): void
{
$appointments = [];
if ($this->http->wrapper()->post()->has('appointments')) {
$appointments = $this->http->wrapper()->post()->retrieve(
'appointments',
$this->refinery->kindlyTo()->dictOf(
$this->refinery->kindlyTo()->int()
)
);
}
if (!count($appointments)) {
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
$this->details();
return;
}
$this->readPermissions();
if (!$this->isEditable() || !$this->areAppointmentsEditable($appointments)) {
$this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
$this->ctrl->returnToParent($this);
}
foreach ($appointments as $app_id) {
$app = new ilCalendarEntry($app_id);
$app->delete();
ilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);
}
$this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
$this->details();
}

public function getHTML(): string
{
$block_gui = new ilCalendarSelectionBlockGUI($this->seed, $this->ref_id);
Expand Down
Loading
Loading