|
@@ 195-203 (lines=9) @@
|
| 192 |
|
return $result; |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
public function archive($id) { |
| 196 |
|
$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 197 |
|
if ($this->boardService->isArchived($this->cardMapper, $id)) { |
| 198 |
|
throw new StatusException('Operation not allowed. This board is archived.'); |
| 199 |
|
} |
| 200 |
|
$card = $this->cardMapper->find($id); |
| 201 |
|
$card->setArchived(true); |
| 202 |
|
return $this->cardMapper->update($card); |
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
public function unarchive($id) { |
| 206 |
|
$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
|
@@ 205-213 (lines=9) @@
|
| 202 |
|
return $this->cardMapper->update($card); |
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
public function unarchive($id) { |
| 206 |
|
$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 207 |
|
if ($this->boardService->isArchived($this->cardMapper, $id)) { |
| 208 |
|
throw new StatusException('Operation not allowed. This board is archived.'); |
| 209 |
|
} |
| 210 |
|
$card = $this->cardMapper->find($id); |
| 211 |
|
$card->setArchived(false); |
| 212 |
|
return $this->cardMapper->update($card); |
| 213 |
|
} |
| 214 |
|
|
| 215 |
|
public function assignLabel($cardId, $labelId) { |
| 216 |
|
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
|
@@ 215-225 (lines=11) @@
|
| 212 |
|
return $this->cardMapper->update($card); |
| 213 |
|
} |
| 214 |
|
|
| 215 |
|
public function assignLabel($cardId, $labelId) { |
| 216 |
|
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
| 217 |
|
if ($this->boardService->isArchived($this->cardMapper, $cardId)) { |
| 218 |
|
throw new StatusException('Operation not allowed. This board is archived.'); |
| 219 |
|
} |
| 220 |
|
$card = $this->cardMapper->find($cardId); |
| 221 |
|
if ($card->getArchived()) { |
| 222 |
|
throw new StatusException('Operation not allowed. This card is archived.'); |
| 223 |
|
} |
| 224 |
|
$this->cardMapper->assignLabel($cardId, $labelId); |
| 225 |
|
} |
| 226 |
|
|
| 227 |
|
public function removeLabel($cardId, $labelId) { |
| 228 |
|
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
|
@@ 227-237 (lines=11) @@
|
| 224 |
|
$this->cardMapper->assignLabel($cardId, $labelId); |
| 225 |
|
} |
| 226 |
|
|
| 227 |
|
public function removeLabel($cardId, $labelId) { |
| 228 |
|
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
| 229 |
|
if ($this->boardService->isArchived($this->cardMapper, $cardId)) { |
| 230 |
|
throw new StatusException('Operation not allowed. This board is archived.'); |
| 231 |
|
} |
| 232 |
|
$card = $this->cardMapper->find($cardId); |
| 233 |
|
if ($card->getArchived()) { |
| 234 |
|
throw new StatusException('Operation not allowed. This card is archived.'); |
| 235 |
|
} |
| 236 |
|
$this->cardMapper->removeLabel($cardId, $labelId); |
| 237 |
|
} |
| 238 |
|
|
| 239 |
|
public function assignUser($cardId, $userId) { |
| 240 |
|
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |