Calendar V3
This commit is contained in:
12
action.php
12
action.php
@@ -168,14 +168,16 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
$slots = CalendarSlot::loadEnabled($this);
|
||||
$indicators = CalendarService::monthIndicators($slots, $year, $month);
|
||||
$slotColors = [];
|
||||
$slotDisplays = [];
|
||||
foreach ($slots as $slot) {
|
||||
$color = $slot->getColor();
|
||||
if ($color !== '') {
|
||||
$slotColors[$slot->getKey()] = $color;
|
||||
}
|
||||
$slotDisplays[$slot->getKey()] = $slot->getDisplay();
|
||||
}
|
||||
|
||||
$html = ChronologicalCalendarWidget::render($year, $month, $baseNs, $indicators, $slotColors);
|
||||
$html = ChronologicalCalendarWidget::render($year, $month, $baseNs, $indicators, $slotColors, $slotDisplays);
|
||||
if ($html === '') {
|
||||
http_status(500);
|
||||
echo 'Calendar rendering failed';
|
||||
@@ -741,7 +743,7 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
$remoteError = '';
|
||||
if ($maintenanceSlot->hasRemoteSource()) {
|
||||
try {
|
||||
$caldavOk = CalDavClient::updateEventStatus(
|
||||
$caldavResult = CalDavClient::updateEventStatus(
|
||||
$maintenanceSlot->getCaldavUrl(),
|
||||
$maintenanceSlot->getUsername(),
|
||||
$maintenanceSlot->getPassword(),
|
||||
@@ -750,13 +752,13 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
$newStatus,
|
||||
$dateIso
|
||||
);
|
||||
if (!$caldavOk) {
|
||||
if ($caldavResult !== '') {
|
||||
$remoteOk = false;
|
||||
$remoteError = $this->getLang('maintenance_remote_write_failed');
|
||||
$remoteError = $this->getLang('maintenance_remote_write_failed') . ': ' . $caldavResult;
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$remoteOk = false;
|
||||
$remoteError = $this->getLang('maintenance_remote_write_failed');
|
||||
$remoteError = $this->getLang('maintenance_remote_write_failed') . ': ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user