add share icon to owner's note as well

This commit is contained in:
Vinzenz
2016-05-31 17:23:15 +02:00
parent a19bc47bd3
commit c84dbf4d97
5 changed files with 26 additions and 2 deletions

View File

@@ -44,7 +44,17 @@ class NoteController extends Controller {
public function index() {
$notes = $this->notemapper->findAll($this->userId);
foreach($notes as $note) {
$note->setIsShared(false);
$note->setIsShared(false);
$sharedWith = $this->notesharemapper->getSharesForNote($note->getId());
if(count($sharedWith) > 0) {
$shareList = array();
foreach($sharedWith as $share) {
$shareList[] = $share->getSharedUser();
}
$note->setSharedWith(implode(", ", $shareList));
} else {
$note->setSharedWith(null);
}
}
$shareEntries = $this->notesharemapper->findForUser($this->userId);
$shares = array();