From 5de44791ff5daddbb9a572a930a89b54738bfaef Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 4 Apr 2016 16:17:41 +0200 Subject: [PATCH 1/7] fix name of preAddService --- inc/inc.Authentication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.Authentication.php b/inc/inc.Authentication.php index f91efff8b..7e4eb9d0b 100644 --- a/inc/inc.Authentication.php +++ b/inc/inc.Authentication.php @@ -97,7 +97,7 @@ $notifier = new SeedDMS_NotificationService(); if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { if(method_exists($notificationObj, 'preAddService')) { - $notificationObj->postAddService($dms, $settings, $notifier); + $notificationObj->preAddService($dms, $settings, $notifier); } } } From f4b6b9b6e1135d1557e8af40f64f4c52bd130412 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 4 Apr 2016 16:40:41 +0200 Subject: [PATCH 2/7] do not pass $dms and $settings to (pre|post)AddService --- inc/inc.Authentication.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/inc.Authentication.php b/inc/inc.Authentication.php index 7e4eb9d0b..3a46c6d1e 100644 --- a/inc/inc.Authentication.php +++ b/inc/inc.Authentication.php @@ -97,7 +97,7 @@ $notifier = new SeedDMS_NotificationService(); if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { if(method_exists($notificationObj, 'preAddService')) { - $notificationObj->preAddService($dms, $settings, $notifier); + $notificationObj->preAddService($notifier); } } } @@ -109,7 +109,7 @@ if($settings->_enableEmail) { if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { if(method_exists($notificationObj, 'postAddService')) { - $notificationObj->postAddService($dms, $settings, $notifier); + $notificationObj->postAddService($notifier); } } } From 369411ec5b6cbb9b388a7d5de38916bd33a331c6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 4 Apr 2016 16:41:09 +0200 Subject: [PATCH 3/7] $settings is not needed --- inc/inc.ClassEmailNotify.php | 1 - 1 file changed, 1 deletion(-) diff --git a/inc/inc.ClassEmailNotify.php b/inc/inc.ClassEmailNotify.php index a165ee728..43aac770e 100644 --- a/inc/inc.ClassEmailNotify.php +++ b/inc/inc.ClassEmailNotify.php @@ -69,7 +69,6 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { * @return false or -1 in case of error, otherwise true */ function toIndividual($sender, $recipient, $subject, $message, $params=array()) { /* {{{ */ - global $settings; if ($recipient->isDisabled() || $recipient->getEmail()=="") return 0; if(!is_object($recipient) && strcasecmp(get_class($recipient), "SeedDMS_Core_User")) { From d59e7c12286fff755c23cf53c7e7ba787a993830 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 09:41:32 +0200 Subject: [PATCH 4/7] remove some duplicate code, do not use classname SeedDMS_Core_User --- inc/inc.ClassEmailNotify.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/inc/inc.ClassEmailNotify.php b/inc/inc.ClassEmailNotify.php index 43aac770e..b458292f4 100644 --- a/inc/inc.ClassEmailNotify.php +++ b/inc/inc.ClassEmailNotify.php @@ -71,18 +71,11 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { function toIndividual($sender, $recipient, $subject, $message, $params=array()) { /* {{{ */ if ($recipient->isDisabled() || $recipient->getEmail()=="") return 0; - if(!is_object($recipient) && strcasecmp(get_class($recipient), "SeedDMS_Core_User")) { + if(!is_object($recipient) || strcasecmp(get_class($recipient), $this->_dms->getClassname('user'))) { return -1; } - if (is_object($sender) && !strcasecmp(get_class($sender), "SeedDMS_Core_User")) { - $from = $sender->getFullName() ." <". $sender->getEmail() .">"; - } elseif(is_string($sender) && trim($sender) != "") { - $from = $sender; - } else - return -1; - - if(is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) { + if(is_object($sender) && !strcasecmp(get_class($sender), $this->_dms->getClassname('user'))) { $from = $sender->getFullName() ." <". $sender->getEmail() .">"; } elseif(is_string($sender) && trim($sender) != "") { $from = $sender; @@ -143,8 +136,8 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { } /* }}} */ function toGroup($sender, $groupRecipient, $subject, $message, $params=array()) { /* {{{ */ - if ((!is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) || - (!is_object($groupRecipient) && strcasecmp(get_class($groupRecipient), "SeedDMS_Core_Group"))) { + if ((!is_object($sender) && strcasecmp(get_class($sender), $this->_dms->getClassname('user'))) || + (!is_object($groupRecipient) || strcasecmp(get_class($groupRecipient), $this->_dms->getClassname('group')))) { return -1; } @@ -156,7 +149,7 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify { } /* }}} */ function toList($sender, $recipients, $subject, $message, $params=array()) { /* {{{ */ - if ((!is_object($sender) && strcasecmp(get_class($sender), "SeedDMS_Core_User")) || + if ((!is_object($sender) && strcasecmp(get_class($sender), $this->_dms->getClassname('user'))) || (!is_array($recipients) && count($recipients)==0)) { return -1; } From c982a23a321c0f9999845d300adf7c4c7d92aa9a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 09:42:46 +0200 Subject: [PATCH 5/7] call hook userMenuItems() --- views/bootstrap/class.Bootstrap.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 1ed802bbe..9542cd01d 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -261,8 +261,18 @@ $(document).ready(function () { echo " ".($this->params['session']->getSu() ? getMLText("switched_to") : getMLText("signed_in_as"))." '".htmlspecialchars($this->params['user']->getFullName())."' \n"; echo "
    \n"; if (!$this->params['user']->isGuest()) { - echo "
  • ".getMLText("my_documents")."
  • \n"; - echo "
  • ".getMLText("my_account")."
  • \n"; + $menuitems = array(); + $menuitems['my_documents'] = array('link'=>"../out/out.MyDocuments.php?inProcess=1", 'label'=>'my_documents'); + $menuitems['my_account'] = array('link'=>"../out/out.MyAccount.php", 'label'=>'my_account'); + $hookObjs = $this->getHookObjects('SeedDMS_View_Bootstrap'); + foreach($hookObjs as $hookObj) { + if (method_exists($hookObj, 'userMenuItems')) { + $menuitems = $hookObj->userMenuItems($this, $menuitems); + } + } + foreach($menuitems as $menuitem) { + echo "
  • ".getMLText($menuitem['label'])."
  • "; + } echo "
  • \n"; } $showdivider = false; From ba9dc0ccb41c863dd4640a763c3e85819014dc9a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 09:43:29 +0200 Subject: [PATCH 6/7] add tbody and thead to table --- views/bootstrap/class.UserList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.UserList.php b/views/bootstrap/class.UserList.php index 1bb1fadad..6d57fcf18 100644 --- a/views/bootstrap/class.UserList.php +++ b/views/bootstrap/class.UserList.php @@ -50,7 +50,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { ?> - + "; @@ -109,7 +109,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { echo ""; echo ""; } - echo "
    "; + echo ""; $this->contentContainerEnd(); $this->contentEnd(); From 58e6f10a938514e28da42806080d84f7eac9cd47 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 09:43:29 +0200 Subject: [PATCH 7/7] add tbody and thead to table --- views/bootstrap/class.UserList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.UserList.php b/views/bootstrap/class.UserList.php index 1bb1fadad..6d57fcf18 100644 --- a/views/bootstrap/class.UserList.php +++ b/views/bootstrap/class.UserList.php @@ -50,7 +50,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { ?> - + "; @@ -109,7 +109,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { echo ""; echo ""; } - echo "
    "; + echo ""; $this->contentContainerEnd(); $this->contentEnd();