From 542ca945f1c6470c5496731fe4165ba463330cf8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 2 Oct 2018 19:19:05 +0200 Subject: [PATCH] users which are subscribers already cannot be selected anymore (Closes #414) use also the same layout in class.DocumentNotify.php and class.FolderNotify.php --- views/bootstrap/class.DocumentNotify.php | 11 ++- views/bootstrap/class.FolderNotify.php | 100 +++++++++++++---------- 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/views/bootstrap/class.DocumentNotify.php b/views/bootstrap/class.DocumentNotify.php index 13bb11a58..8d7317b0e 100644 --- a/views/bootstrap/class.DocumentNotify.php +++ b/views/bootstrap/class.DocumentNotify.php @@ -81,7 +81,13 @@ $(document).ready( function() { $this->contentHeading(getMLText("edit_existing_notify")); $userNotifyIDs = array(); + foreach ($notifyList["users"] as $userNotify) { + $userNotifyIDs[] = $userNotify->getID(); + } $groupNotifyIDs = array(); + foreach ($notifyList["groups"] as $groupNotify) { + $groupNotifyIDs[] = $groupNotify->getID(); + } echo "
\n"; echo "
\n"; @@ -114,7 +120,6 @@ $(document).ready( function() { 'options'=>$options ) ); - $options = array(); $options[] = array('-1', getMLText("select_one")); $allGroups = $dms->getAllGroups(); @@ -160,7 +165,6 @@ $(document).ready( function() { print "\n"; }else print ""; print ""; - $userNotifyIDs[] = $userNotify->getID(); } foreach ($notifyList["groups"] as $groupNotify) { print ""; @@ -174,11 +178,10 @@ $(document).ready( function() { print "getID()."\">\n"; print ""; print ""; - print "\n"; print ""; + print "\n"; }else print ""; print ""; - $groupNotifyIDs[] = $groupNotify->getID(); } } print "\n"; diff --git a/views/bootstrap/class.FolderNotify.php b/views/bootstrap/class.FolderNotify.php index 990202377..2ac72d76b 100644 --- a/views/bootstrap/class.FolderNotify.php +++ b/views/bootstrap/class.FolderNotify.php @@ -82,55 +82,20 @@ $(document).ready(function() { $this->contentContainerStart(); $userNotifyIDs = array(); + foreach ($notifyList["users"] as $userNotify) { + $userNotifyIDs[] = $userNotify->getID(); + } $groupNotifyIDs = array(); - - print "\n"; - if (empty($notifyList["users"]) && empty($notifyList["groups"])) { - print ""; + foreach ($notifyList["groups"] as $groupNotify) { + $groupNotifyIDs[] = $groupNotify->getID(); } - else { - foreach ($notifyList["users"] as $userNotify) { - print ""; - print ""; - print ""; - if ($user->isAdmin() || $user->getID() == $userNotify->getID()) { - print "\n"; - echo createHiddenFieldWithKey('foldernotify')."\n"; - print "getID()."\">\n"; - print "\n"; - print "getID()."\">\n"; - print ""; - print "\n"; - }else print ""; - print ""; - $userNotifyIDs[] = $userNotify->getID(); - } - foreach ($notifyList["groups"] as $groupNotify) { - print ""; - print ""; - print ""; - if ($user->isAdmin() || $groupNotify->isMember($user,true)) { - print "\n"; - echo createHiddenFieldWithKey('foldernotify')."\n"; - print "getID()."\">\n"; - print "\n"; - print "getID()."\">\n"; - print ""; - print "\n"; - }else print ""; - print ""; - $groupNotifyIDs[] = $groupNotify->getID(); - } - } - print "
".getMLText("empty_notify_list")."
" . htmlspecialchars($userNotify->getFullName()) . "
"; - print ""; - print "
" . htmlspecialchars($groupNotify->getName()) . "
"; - print ""; - print "
\n"; + echo "
\n"; + echo "
\n"; + $this->contentContainerStart(); ?> -
+
@@ -176,9 +141,54 @@ $(document).ready(function() { $this->formSubmit(getMLText('add')); ?>
- contentContainerEnd(); + echo "
\n"; + echo "
\n"; + print "\n"; + if (empty($notifyList["users"]) && empty($notifyList["groups"])) { + print ""; + } + else { + foreach ($notifyList["users"] as $userNotify) { + print ""; + print ""; + print ""; + if ($user->isAdmin() || $user->getID() == $userNotify->getID()) { + print "\n"; + echo createHiddenFieldWithKey('foldernotify')."\n"; + print "getID()."\">\n"; + print "\n"; + print "getID()."\">\n"; + print ""; + print "\n"; + }else print ""; + print ""; + } + foreach ($notifyList["groups"] as $groupNotify) { + print ""; + print ""; + print ""; + if ($user->isAdmin() || $groupNotify->isMember($user,true)) { + print "\n"; + echo createHiddenFieldWithKey('foldernotify')."\n"; + print "getID()."\">\n"; + print "\n"; + print "getID()."\">\n"; + print ""; + print "\n"; + }else print ""; + print ""; + } + } + print "
".getMLText("empty_notify_list")."
" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "
"; + print ""; + print "
" . htmlspecialchars($groupNotify->getName()) . "
"; + print ""; + print "
\n"; + + echo "
\n"; + echo "
\n"; $this->contentEnd(); $this->htmlEndPage(); } /* }}} */