add share icon to owner's note as well

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

No files matched your search

+11 -1
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();