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
70 changes: 35 additions & 35 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,46 @@
*/

return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],

// share
['name' => 'share#searchUser', 'url' => '/share/search/{search}', 'verb' => 'GET'],
// share
['name' => 'share#searchUser', 'url' => '/share/search/{search}', 'verb' => 'GET'],

// boards
['name' => 'board#index', 'url' => '/boards', 'verb' => 'GET'],
['name' => 'board#create', 'url' => '/boards', 'verb' => 'POST'],
['name' => 'board#read', 'url' => '/boards/{boardId}', 'verb' => 'GET'],
['name' => 'board#update', 'url' => '/boards/{boardId}', 'verb' => 'PUT'],
['name' => 'board#delete', 'url' => '/boards/{boardId}', 'verb' => 'DELETE'],
// boards
['name' => 'board#index', 'url' => '/boards', 'verb' => 'GET'],
['name' => 'board#create', 'url' => '/boards', 'verb' => 'POST'],
['name' => 'board#read', 'url' => '/boards/{boardId}', 'verb' => 'GET'],
['name' => 'board#update', 'url' => '/boards/{boardId}', 'verb' => 'PUT'],
['name' => 'board#delete', 'url' => '/boards/{boardId}', 'verb' => 'DELETE'],
['name' => 'board#getUserPermissions', 'url' => '/boards/{boardId}/permissions', 'verb' => 'GET'],
['name' => 'board#addAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'POST'],
['name' => 'board#updateAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'PUT'],
['name' => 'board#deleteAcl', 'url' => '/boards/{boardId}/acl/{aclId}', 'verb' => 'DELETE'],
['name' => 'board#addAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'POST'],
['name' => 'board#updateAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'PUT'],
['name' => 'board#deleteAcl', 'url' => '/boards/{boardId}/acl/{aclId}', 'verb' => 'DELETE'],

// stacks
['name' => 'stack#index', 'url' => '/stacks/{boardId}', 'verb' => 'GET'],
['name' => 'stack#create', 'url' => '/stacks', 'verb' => 'POST'],
['name' => 'stack#update', 'url' => '/stacks/{stackId}', 'verb' => 'PUT'],
['name' => 'stack#delete', 'url' => '/stacks/{stackId}', 'verb' => 'DELETE'],
['name' => 'stack#archived', 'url' => '/stacks/{boardId}/archived', 'verb' => 'GET'],
// stacks
['name' => 'stack#index', 'url' => '/stacks/{boardId}', 'verb' => 'GET'],
['name' => 'stack#create', 'url' => '/stacks', 'verb' => 'POST'],
['name' => 'stack#update', 'url' => '/stacks/{stackId}', 'verb' => 'PUT'],
['name' => 'stack#delete', 'url' => '/stacks/{stackId}', 'verb' => 'DELETE'],
['name' => 'stack#archived', 'url' => '/stacks/{boardId}/archived', 'verb' => 'GET'],

// cards
['name' => 'card#read', 'url' => '/cards/{cardId}', 'verb' => 'GET'],
['name' => 'card#create', 'url' => '/cards', 'verb' => 'POST'],
['name' => 'card#update', 'url' => '/cards/{cardId}', 'verb' => 'PUT'],
['name' => 'card#delete', 'url' => '/cards/{cardId}', 'verb' => 'DELETE'],
['name' => 'card#rename', 'url' => '/cards/{cardId}/rename', 'verb' => 'PUT'],
['name' => 'card#reorder', 'url' => '/cards/{cardId}/reorder', 'verb' => 'PUT'],
['name' => 'card#archive', 'url' => '/cards/{cardId}/archive', 'verb' => 'PUT'],
['name' => 'card#unarchive', 'url' => '/cards/{cardId}/unarchive', 'verb' => 'PUT'],
['name' => 'card#assignLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'POST'],
['name' => 'card#removeLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'DELETE'],
// cards
['name' => 'card#read', 'url' => '/cards/{cardId}', 'verb' => 'GET'],
['name' => 'card#create', 'url' => '/cards', 'verb' => 'POST'],
['name' => 'card#update', 'url' => '/cards/{cardId}', 'verb' => 'PUT'],
['name' => 'card#delete', 'url' => '/cards/{cardId}', 'verb' => 'DELETE'],
['name' => 'card#rename', 'url' => '/cards/{cardId}/rename', 'verb' => 'PUT'],
['name' => 'card#reorder', 'url' => '/cards/{cardId}/reorder', 'verb' => 'PUT'],
['name' => 'card#archive', 'url' => '/cards/{cardId}/archive', 'verb' => 'PUT'],
['name' => 'card#unarchive', 'url' => '/cards/{cardId}/unarchive', 'verb' => 'PUT'],
['name' => 'card#assignLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'POST'],
['name' => 'card#removeLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'DELETE'],

// labels
['name' => 'label#create', 'url' => '/labels', 'verb' => 'POST'],
['name' => 'label#update', 'url' => '/labels/{labelId}', 'verb' => 'PUT'],
['name' => 'label#delete', 'url' => '/labels/{labelId}', 'verb' => 'DELETE'],
// labels
['name' => 'label#create', 'url' => '/labels', 'verb' => 'POST'],
['name' => 'label#update', 'url' => '/labels/{labelId}', 'verb' => 'PUT'],
['name' => 'label#delete', 'url' => '/labels/{labelId}', 'verb' => 'DELETE'],

]
]
];
8 changes: 4 additions & 4 deletions lib/Controller/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function __construct($appName, IRequest $request, IUserManager $userManag
$this->userInfo = $this->getBoardPrerequisites();
}

/**
* TODO: move to boardservice
* @return array
*/
/**
* TODO: move to boardservice
* @return array
*/
private function getBoardPrerequisites() {
$groups = $this->groupManager->getUserGroupIds(
$this->userManager->get($this->userId)
Expand Down
74 changes: 37 additions & 37 deletions lib/Controller/CardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@

class CardController extends Controller {

private $userId;
private $cardService;
private $userId;
private $cardService;

public function __construct($appName, IRequest $request, CardService $cardService, $userId) {
parent::__construct($appName, $request);
$this->userId = $userId;
$this->cardService = $cardService;
}
public function __construct($appName, IRequest $request, CardService $cardService, $userId) {
parent::__construct($appName, $request);
$this->userId = $userId;
$this->cardService = $cardService;
}

/**
* @NoAdminRequired
* @param $cardId
* @return \OCP\AppFramework\Db\Entity
*/
public function read($cardId) {
return $this->cardService->find($cardId);
}
public function read($cardId) {
return $this->cardService->find($cardId);
}

/**
* @NoAdminRequired
Expand All @@ -54,19 +54,19 @@ public function read($cardId) {
* @param $order
* @return array
*/
public function reorder($cardId, $stackId, $order) {
return $this->cardService->reorder($cardId, $stackId, $order);
}
public function reorder($cardId, $stackId, $order) {
return $this->cardService->reorder($cardId, $stackId, $order);
}

/**
* @NoAdminRequired
* @param $cardId
* @param $title
* @return \OCP\AppFramework\Db\Entity
*/
public function rename($cardId, $title) {
return $this->cardService->rename($cardId, $title);
}
public function rename($cardId, $title) {
return $this->cardService->rename($cardId, $title);
}

/**
* @NoAdminRequired
Expand All @@ -76,9 +76,9 @@ public function rename($cardId, $title) {
* @param int $order
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $stackId, $type, $order = 999) {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId);
}
public function create($title, $stackId, $type, $order = 999) {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId);
}

/**
* @NoAdminRequired
Expand All @@ -90,53 +90,53 @@ public function create($title, $stackId, $type, $order = 999) {
* @param $description
* @return \OCP\AppFramework\Db\Entity
*/
public function update($id, $title, $stackId, $type, $order, $description) {
return $this->cardService->update($id, $title, $stackId, $type, $order, $description, $this->userId);
}
public function update($id, $title, $stackId, $type, $order, $description) {
return $this->cardService->update($id, $title, $stackId, $type, $order, $description, $this->userId);
}

/**
* @NoAdminRequired
* @param $cardId
* @return \OCP\AppFramework\Db\Entity
*/
public function delete($cardId) {
return $this->cardService->delete($cardId);
}
public function delete($cardId) {
return $this->cardService->delete($cardId);
}

/**
* @NoAdminRequired
* @param $cardId
* @return \OCP\AppFramework\Db\Entity
*/
public function archive($cardId) {
return $this->cardService->archive($cardId);
}
public function archive($cardId) {
return $this->cardService->archive($cardId);
}

/**
* @NoAdminRequired
* @param $cardId
* @return \OCP\AppFramework\Db\Entity
*/
public function unarchive($cardId) {
return $this->cardService->unarchive($cardId);
}
public function unarchive($cardId) {
return $this->cardService->unarchive($cardId);
}

/**
* @NoAdminRequired
* @param $cardId
* @param $labelId
*/
public function assignLabel($cardId, $labelId) {
$this->cardService->assignLabel($cardId, $labelId);
}
public function assignLabel($cardId, $labelId) {
$this->cardService->assignLabel($cardId, $labelId);
}

/**
* @NoAdminRequired
* @param $cardId
* @param $labelId
*/
public function removeLabel($cardId, $labelId) {
$this->cardService->removeLabel($cardId, $labelId);
}
public function removeLabel($cardId, $labelId) {
$this->cardService->removeLabel($cardId, $labelId);
}

}
28 changes: 14 additions & 14 deletions lib/Controller/LabelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

class LabelController extends Controller {

private $labelService;
private $labelService;

public function __construct($appName, IRequest $request, LabelService $labelService) {
parent::__construct($appName, $request);
$this->labelService = $labelService;
}
public function __construct($appName, IRequest $request, LabelService $labelService) {
parent::__construct($appName, $request);
$this->labelService = $labelService;
}

/**
* @NoAdminRequired
Expand All @@ -44,9 +44,9 @@ public function __construct($appName, IRequest $request, LabelService $labelServ
* @param $boardId
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $color, $boardId) {
return $this->labelService->create($title, $color, $boardId);
}
public function create($title, $color, $boardId) {
return $this->labelService->create($title, $color, $boardId);
}

/**
* @NoAdminRequired
Expand All @@ -55,17 +55,17 @@ public function create($title, $color, $boardId) {
* @param $color
* @return \OCP\AppFramework\Db\Entity
*/
public function update($id, $title, $color) {
return $this->labelService->update($id, $title, $color);
}
public function update($id, $title, $color) {
return $this->labelService->update($id, $title, $color);
}

/**
* @NoAdminRequired
* @param $labelId
* @return \OCP\AppFramework\Db\Entity
*/
public function delete($labelId) {
return $this->labelService->delete($labelId);
}
public function delete($labelId) {
return $this->labelService->delete($labelId);
}

}
44 changes: 22 additions & 22 deletions lib/Controller/StackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@


class StackController extends Controller {
private $userId;
private $stackService;
public function __construct($appName, IRequest $request, StackService $cardService, $userId) {
parent::__construct($appName, $request);
$this->userId = $userId;
$this->stackService = $cardService;
}
private $userId;
private $stackService;
public function __construct($appName, IRequest $request, StackService $cardService, $userId) {
parent::__construct($appName, $request);
$this->userId = $userId;
$this->stackService = $cardService;
}

/**
* @NoAdminRequired
* @param $boardId
* @return array
*/
public function index($boardId) {
return $this->stackService->findAll($boardId);
}
public function index($boardId) {
return $this->stackService->findAll($boardId);
}

/**
* @NoAdminRequired
* @param $boardId
* @return array
*/
public function archived($boardId) {
return $this->stackService->findAllArchived($boardId);
}
public function archived($boardId) {
return $this->stackService->findAllArchived($boardId);
}

/**
* @NoAdminRequired
Expand All @@ -64,9 +64,9 @@ public function archived($boardId) {
* @param int $order
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $boardId, $order = 999) {
return $this->stackService->create($title, $boardId, $order);
}
public function create($title, $boardId, $order = 999) {
return $this->stackService->create($title, $boardId, $order);
}

/**
* @NoAdminRequired
Expand All @@ -76,16 +76,16 @@ public function create($title, $boardId, $order = 999) {
* @param $order
* @return \OCP\AppFramework\Db\Entity
*/
public function update($id, $title, $boardId, $order) {
return $this->stackService->update($id, $title, $boardId, $order);
}
public function update($id, $title, $boardId, $order) {
return $this->stackService->update($id, $title, $boardId, $order);
}

/**
* @NoAdminRequired
* @param $stackId
* @return \OCP\AppFramework\Db\Entity
*/
public function delete($stackId) {
return $this->stackService->delete($stackId);
}
public function delete($stackId) {
return $this->stackService->delete($stackId);
}
}
Loading