shared board option show_only_assigned_cards or all due dates

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2021-03-17 09:15:11 +01:00
parent 26f68475f7
commit 6d6faf65e6
8 changed files with 70 additions and 10 deletions

View File

@@ -422,13 +422,14 @@ class BoardService {
* @param $title
* @param $color
* @param $archived
* @param $upcoming_show_only_assigned_cards
* @return \OCP\AppFramework\Db\Entity
* @throws DoesNotExistException
* @throws \OCA\Deck\NoPermissionException
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
* @throws BadRequestException
*/
public function update($id, $title, $color, $archived) {
public function update($id, $title, $color, $archived, $upcoming_show_only_assigned_cards) {
if (is_numeric($id) === false) {
throw new BadRequestException('board id must be a number');
}
@@ -445,12 +446,17 @@ class BoardService {
throw new BadRequestException('archived must be a boolean');
}
if (is_bool($upcoming_show_only_assigned_cards) === false) {
throw new BadRequestException('upcoming_show_only_assigned_cards must be a boolean');
}
$this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_MANAGE);
$board = $this->find($id);
$changes = new ChangeSet($board);
$board->setTitle($title);
$board->setColor($color);
$board->setArchived($archived);
$board->setUpcoming_show_only_assigned_cards($upcoming_show_only_assigned_cards);
$changes->setAfter($board);
$this->boardMapper->update($board); // operate on clone so we can check for updated fields
$this->boardMapper->mapOwner($board);