From 47f77d9d4caeb9faa425866d164fe68f5163348f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 30 Nov 2021 17:18:43 +0100 Subject: [PATCH 1/2] send mails to owner of doc only if not logged or in list of notifiers --- inc/inc.ClassNotificationService.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/inc/inc.ClassNotificationService.php b/inc/inc.ClassNotificationService.php index 341677f91..2728eef1b 100644 --- a/inc/inc.ClassNotificationService.php +++ b/inc/inc.ClassNotificationService.php @@ -919,7 +919,11 @@ class SeedDMS_NotificationService { $this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); } -// $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); + /* Send mail to owner only if the currently logged in user is not the + * owner and the owner is not already in the list of notifiers. + */ + if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users'])) + $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); } /* }}} */ public function sendNewDocumentNotifyMail($document, $user, $obj) { /* {{{ */ @@ -1012,7 +1016,11 @@ class SeedDMS_NotificationService { foreach ($nl["groups"] as $grp) { $this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); } -// $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); + /* Send mail to owner only if the currently logged in user is not the + * owner and the owner is not already in the list of notifiers. + */ + if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users'])) + $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); } /* }}} */ public function sendSubmittedApprovalMail($content, $user, $approvelog) { /* {{{ */ @@ -1035,7 +1043,12 @@ class SeedDMS_NotificationService { $this->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); foreach ($nl["groups"] as $grp) $this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); -// $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); + + /* Send mail to owner only if the currently logged in user is not the + * owner and the owner is not already in the list of notifiers. + */ + if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users'])) + $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); } /* }}} */ From 11dabf2cb001da97277781cb373730cfc764e265 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 1 Dec 2021 11:13:26 +0100 Subject: [PATCH 2/2] make jqtree look nice again --- views/bootstrap/class.Bootstrap.php | 6 +++--- views/bootstrap/styles/application.css | 12 +++--------- views/bootstrap4/class.Bootstrap4.php | 4 ++-- views/bootstrap4/styles/application.css | 12 +++--------- views/bootstrap4/styles/styles.css | 19 ------------------- 5 files changed, 11 insertions(+), 42 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 81efcbe50..8fe421235 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2044,7 +2044,7 @@ $(document).ready(function() { function printNewTreeNavigationHtml($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */ //echo "
\n"; - echo "
\n"; + echo "
\n"; } /* }}} */ /** @@ -2167,9 +2167,9 @@ $(function() { onCreateLi: function(node, $li) { // Add 'icon' span before title if(node.is_folder) - $li.find('.jqtree-title').before(' ').attr('data-name', node.name).attr('rel', 'folder_' + node.id).attr('formtoken', '').attr('data-uploadformtoken', '').attr('data-droptarget', 'folder_' + node.id).addClass('droptarget'); + $li.find('.jqtree-title').prepend(' ').attr('data-name', node.name).attr('rel', 'folder_' + node.id).attr('formtoken', '').attr('data-uploadformtoken', '').attr('data-droptarget', 'folder_' + node.id).addClass('droptarget'); else - $li.find('.jqtree-title').before(' '); + $li.find('.jqtree-title').prepend(' '); } }); // Unfold node for currently selected folder diff --git a/views/bootstrap/styles/application.css b/views/bootstrap/styles/application.css index 52d15a855..83b33f662 100644 --- a/views/bootstrap/styles/application.css +++ b/views/bootstrap/styles/application.css @@ -88,18 +88,12 @@ ul.jqtree-tree li.jqtree-selected > .jqtree-element:hover { font-weight: bold; } -ul.jqtree-tree ul.jqtree_common { - margin-left: 19px; -} -ul.jqtree-tree .jqtree-title { - margin-left: 0.5em; -} -ul.jqtree-tree .jqtree-title.jqtree-title-folder { - margin-left: 0.5em; +ul.jqtree-tree li.jqtree_common { + margin-left: 8px; } ul.jqtree-tree li.jqtree_common > .jqtree-element:hover { - background-color: #E0E0E0; + background-color: #E0E0E0; } legend > span { diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 295e78d48..a19107e8f 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -2211,9 +2211,9 @@ $(function() { onCreateLi: function(node, $li) { // Add 'icon' span before title if(node.is_folder) - $li.find('.jqtree-title').before(' ').attr('data-name', node.name).attr('rel', 'folder_' + node.id).attr('formtoken', '').attr('data-uploadformtoken', '').attr('data-droptarget', 'folder_' + node.id).addClass('droptarget'); + $li.find('.jqtree-title').prepend(' ').attr('data-name', node.name).attr('rel', 'folder_' + node.id).attr('formtoken', '').attr('data-uploadformtoken', '').attr('data-droptarget', 'folder_' + node.id).addClass('droptarget'); else - $li.find('.jqtree-title').before(' '); + $li.find('.jqtree-title').prepend(' '); } }); // Unfold node for currently selected folder diff --git a/views/bootstrap4/styles/application.css b/views/bootstrap4/styles/application.css index f76fd79d6..76cbc7813 100644 --- a/views/bootstrap4/styles/application.css +++ b/views/bootstrap4/styles/application.css @@ -103,18 +103,12 @@ ul.jqtree-tree li.jqtree-selected > .jqtree-element:hover { font-weight: bold; } -ul.jqtree-tree ul.jqtree_common { - margin-left: 19px; -} -ul.jqtree-tree .jqtree-title { - margin-left: 0.5em; -} -ul.jqtree-tree .jqtree-title.jqtree-title-folder { - margin-left: 0.5em; +ul.jqtree-tree li.jqtree_common { + margin-left: 8px; } ul.jqtree-tree li.jqtree_common > .jqtree-element:hover { - background-color: #E0E0E0; + background-color: #E0E0E0; } legend > span { diff --git a/views/bootstrap4/styles/styles.css b/views/bootstrap4/styles/styles.css index 95133c727..19f7d45d3 100644 --- a/views/bootstrap4/styles/styles.css +++ b/views/bootstrap4/styles/styles.css @@ -1,22 +1,3 @@ -ul.jqtree-tree ul.jqtree_common { - margin-left: 22px; -} -ul.jqtree-tree li.jqtree_common { - margin-left: 0px; -} -ul.jqtree-tree li.jqtree_folder { - margin-left: 0px; -} -ul.jqtree-tree .jqtree-title { - margin-left: 0.3em; -} -ul.jqtree-tree .jqtree-title.jqtree-title-folder { - margin-left: 0.3em; -} -ul.jqtree-tree .jqtree-element { - display: initial; -} - /* Sticky footer styles -------------------------------------------------- */ html {