Skip to content

Commit

Permalink
Fixed related to #184
Browse files Browse the repository at this point in the history
  • Loading branch information
Parziphal committed Jul 29, 2016
1 parent 64da044 commit 6ea152b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/controllers/DmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,17 @@ public function show()
$this->dmail->mark_as_read($this->current_user);
}
}

public function confirmMarkAllRead()
{
}

public function markAllRead()
{
if ($this->params()->commit == "Yes") {
foreach (Dmail::where("to_id = ? and has_seen = false", $this->current_user->id)->take() as $dmail)
$dmail->updateAttribute('has_seen', true);
foreach (Dmail::where("to_id = ? and has_seen = false", $this->current_user->id)->take() as $dmail)
$dmail->updateAttribute('has_seen', true);

$this->current_user->updateAttribute('has_mail', false);
$this->respond_to_success("All messages marked as read", ['action' => "inbox"]);
} else {
$this->redirectTo("#inbox");
}
$this->current_user->updateAttribute('has_mail', false);
$this->respond_to_success("All messages marked as read", ['action' => "inbox"]);
}
}

0 comments on commit 6ea152b

Please sign in to comment.