Merge branch 'seeddms-5.0.x' into develop

This commit is contained in:
Uwe Steinmann 2016-04-05 10:05:05 +02:00
commit 552c3b4d98
3 changed files with 20 additions and 18 deletions

View File

@ -98,7 +98,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($notifier);
}
}
}
@ -110,7 +110,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);
}
}
}

View File

@ -69,21 +69,13 @@ 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")) {
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;
@ -129,8 +121,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;
}
@ -142,7 +134,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;
}

View File

@ -330,9 +330,19 @@ $(document).ready(function () {
echo " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".($this->params['session']->getSu() ? getMLText("switched_to") : getMLText("signed_in_as"))." '".htmlspecialchars($this->params['user']->getFullName())."' <i class=\"icon-caret-down\"></i></a>\n";
echo " <ul class=\"dropdown-menu\" role=\"menu\">\n";
if (!$this->params['user']->isGuest()) {
echo " <li><a href=\"../out/out.MyDocuments.php?inProcess=1\">".getMLText("my_documents")."</a></li>\n";
echo " <li><a href=\"../out/out.MyAccount.php\">".getMLText("my_account")."</a></li>\n";
echo " <li><a href=\"../out/out.TransmittalMgr.php\">".getMLText("my_transmittals")."</a></li>\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');
$menuitems['my_transmittals'] = array('link'=>"../out/out.TransmittalMgr.php", 'label'=>'my_transmittals');
$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 "<li><a href=\"".$menuitem['link']."\">".getMLText($menuitem['label'])."</a></li>";
}
echo " <li class=\"divider\"></li>\n";
}
$showdivider = false;