Skip to content
Merged
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
23 changes: 23 additions & 0 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function setConfig(string $key,
return $this->setDefaultReminder($value);
case 'showTasks':
return $this->setShowTasks($value);
case 'attachmentsFolder':
return $this->setAttachmentsFolder($value);
default:
return new JSONResponse([], Http::STATUS_BAD_REQUEST);
}
Expand Down Expand Up @@ -171,6 +173,27 @@ private function setShowTasks(string $value):JSONResponse {
return new JSONResponse();
}

/**
* Set config for attachments folder
*
* @param string $value
* @return JSONResponse
*/
private function setAttachmentsFolder(string $value):JSONResponse {
try {
$this->config->setUserValue(
$this->userId,
'dav',
'attachmentsFolder',
$value
);
} catch (\Exception $e) {
return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);
}

return new JSONResponse();
}

/**
* set config value for showing week numbers
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function index():TemplateResponse {
$showWeekNumbers = $this->config->getUserValue($this->userId, $this->appName, 'showWeekNr', $defaultWeekNumbers) === 'yes';
$skipPopover = $this->config->getUserValue($this->userId, $this->appName, 'skipPopover', $defaultSkipPopover) === 'yes';
$timezone = $this->config->getUserValue($this->userId, $this->appName, 'timezone', $defaultTimezone);
$attachmentsFolder = $this->config->getUserValue($this->userId, 'dav', 'attachmentsFolder', '/Calendar');
$slotDuration = $this->config->getUserValue($this->userId, $this->appName, 'slotDuration', $defaultSlotDuration);
$defaultReminder = $this->config->getUserValue($this->userId, $this->appName, 'defaultReminder', $defaultDefaultReminder);
$showTasks = $this->config->getUserValue($this->userId, $this->appName, 'showTasks', $defaultShowTasks) === 'yes';
Expand All @@ -124,6 +125,7 @@ public function index():TemplateResponse {
$this->initialStateService->provideInitialState('talk_enabled', $talkEnabled);
$this->initialStateService->provideInitialState('talk_api_version', $talkApiVersion);
$this->initialStateService->provideInitialState('timezone', $timezone);
$this->initialStateService->provideInitialState('attachments_folder', $attachmentsFolder);
$this->initialStateService->provideInitialState('slot_duration', $slotDuration);
$this->initialStateService->provideInitialState('default_reminder', $defaultReminder);
$this->initialStateService->provideInitialState('show_tasks', $showTasks);
Expand Down
177 changes: 159 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading