Mark notification as read if a card with duedate gets archived
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -95,6 +95,15 @@ class NotificationHelper {
|
||||
$this->cardMapper->markNotified($card);
|
||||
}
|
||||
|
||||
public function markDuedateAsRead($card) {
|
||||
$notification = $this->notificationManager->createNotification();
|
||||
$notification
|
||||
->setApp('deck')
|
||||
->setObject('card', $card->getId())
|
||||
->setSubject('card-overdue', []);
|
||||
$this->notificationManager->markProcessed($notification);
|
||||
}
|
||||
|
||||
public function sendCardAssigned($card, $userId) {
|
||||
$boardId = $this->cardMapper->findBoardId($card->getId());
|
||||
$board = $this->getBoard($boardId);
|
||||
|
||||
@@ -407,6 +407,7 @@ class CardService {
|
||||
$card = $this->cardMapper->find($id);
|
||||
$card->setArchived(true);
|
||||
$newCard = $this->cardMapper->update($card);
|
||||
$this->notificationHelper->markDuedateAsRead($card);
|
||||
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $newCard, ActivityManager::SUBJECT_CARD_UPDATE_ARCHIVE);
|
||||
$this->changeHelper->cardChanged($id, false);
|
||||
return $newCard;
|
||||
|
||||
Reference in New Issue
Block a user