| @@ 112-129 (lines=18) @@ | ||
| 109 | * @param string $view |
|
| 110 | * @return JSONResponse |
|
| 111 | */ |
|
| 112 | private function setView($view) { |
|
| 113 | if (!$this->isViewAllowed($view)) { |
|
| 114 | return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY); |
|
| 115 | } |
|
| 116 | ||
| 117 | try { |
|
| 118 | $this->config->setUserValue( |
|
| 119 | $this->userId, |
|
| 120 | $this->appName, |
|
| 121 | 'currentView', |
|
| 122 | $view |
|
| 123 | ); |
|
| 124 | } catch(\Exception $e) { |
|
| 125 | return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR); |
|
| 126 | } |
|
| 127 | ||
| 128 | return new JSONResponse(); |
|
| 129 | } |
|
| 130 | ||
| 131 | ||
| 132 | /** |
|
| @@ 176-193 (lines=18) @@ | ||
| 173 | * @param $value |
|
| 174 | * @return JSONResponse |
|
| 175 | */ |
|
| 176 | private function setSkipPopover($value) { |
|
| 177 | if (!$this->isSkipPopoverValueAllowed($value)) { |
|
| 178 | return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY); |
|
| 179 | } |
|
| 180 | ||
| 181 | try { |
|
| 182 | $this->config->setUserValue( |
|
| 183 | $this->userId, |
|
| 184 | $this->appName, |
|
| 185 | 'skipPopover', |
|
| 186 | $value |
|
| 187 | ); |
|
| 188 | } catch(\Exception $e) { |
|
| 189 | return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR); |
|
| 190 | } |
|
| 191 | ||
| 192 | return new JSONResponse(); |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * get if popover shall be skipped |
|
| @@ 238-255 (lines=18) @@ | ||
| 235 | * @param $value |
|
| 236 | * @return JSONResponse |
|
| 237 | */ |
|
| 238 | private function setShowWeekNr($value) { |
|
| 239 | if (!$this->isShowWeekNrValueAllowed($value)) { |
|
| 240 | return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY); |
|
| 241 | } |
|
| 242 | ||
| 243 | try { |
|
| 244 | $this->config->setUserValue( |
|
| 245 | $this->userId, |
|
| 246 | $this->appName, |
|
| 247 | 'showWeekNr', |
|
| 248 | $value |
|
| 249 | ); |
|
| 250 | } catch(\Exception $e) { |
|
| 251 | return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR); |
|
| 252 | } |
|
| 253 | ||
| 254 | return new JSONResponse(); |
|
| 255 | } |
|
| 256 | ||
| 257 | /** |
|
| 258 | * get config value for showing week numbers |
|