mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
2bb27b5b8e
|
@ -276,6 +276,8 @@
|
||||||
- groups from ldap can be synced with seeddms groups
|
- groups from ldap can be synced with seeddms groups
|
||||||
- fix error when sending notification to group of reviewers
|
- fix error when sending notification to group of reviewers
|
||||||
- seperate some notification messages for folders and documents
|
- seperate some notification messages for folders and documents
|
||||||
|
- fix drag&drop of attachments
|
||||||
|
- do not sent notifidation mail to uploader if owner has received on already
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.31
|
Changes in version 5.1.31
|
||||||
|
|
|
@ -85,6 +85,9 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ImagickException $e) {
|
} catch (ImagickException $e) {
|
||||||
|
if($this->logger) {
|
||||||
|
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with pdf service failed: '.$e->getMessage(), PEAR_LOG_ERR);
|
||||||
|
}
|
||||||
$this->success = false;
|
$this->success = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ class SeedDMS_NotificationService {
|
||||||
$to = '';
|
$to = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$params['__recvtype__'] = $recvtype;
|
||||||
|
|
||||||
/* Call filter of notification service if set */
|
/* Call filter of notification service if set */
|
||||||
if(!is_callable([$service, 'filter']) || $service->filter($sender, $recipient, $subject, $message, $params, $recvtype)) {
|
if(!is_callable([$service, 'filter']) || $service->filter($sender, $recipient, $subject, $message, $params, $recvtype)) {
|
||||||
if(!$service->toIndividual($sender, $recipient, $subject, $message, $params)) {
|
if(!$service->toIndividual($sender, $recipient, $subject, $message, $params)) {
|
||||||
|
@ -433,8 +435,11 @@ class SeedDMS_NotificationService {
|
||||||
false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
|
|
||||||
/* Send mail to uploader of version */
|
/* Send mail to uploader of version only if the uploader is not the owner and
|
||||||
if($user->getID() != $version->getUser()->getID() && false === SeedDMS_Core_DMS::inList($version->getUser(), $nl['users']))
|
* the currently logged in user is not the
|
||||||
|
* owner and the owner is not already in the list of notifiers.
|
||||||
|
*/
|
||||||
|
if($user->getID() != $version->getUser()->getID() && $version->getUser()->getID() != $document->getOwner() && false === SeedDMS_Core_DMS::inList($version->getUser(), $nl['users']))
|
||||||
$this->toIndividual($user, $version->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
$this->toIndividual($user, $version->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -564,8 +569,11 @@ class SeedDMS_NotificationService {
|
||||||
false === SeedDMS_Core_DMS::inList($document->getOwner(), $notifyList['users']))
|
false === SeedDMS_Core_DMS::inList($document->getOwner(), $notifyList['users']))
|
||||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
|
|
||||||
/* Send mail to uploader of version */
|
/* Send mail to uploader of version only if the uploader is not the owner and
|
||||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
* the currently logged in user is not the
|
||||||
|
* owner and the owner is not already in the list of notifiers.
|
||||||
|
*/
|
||||||
|
if($user->getID() != $content->getUser()->getID() && $content->getUser()->getID() != $document->getOwner() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -579,6 +587,7 @@ class SeedDMS_NotificationService {
|
||||||
$subject = "removed_file_email_subject";
|
$subject = "removed_file_email_subject";
|
||||||
$message = "removed_file_email_body";
|
$message = "removed_file_email_body";
|
||||||
$params = array();
|
$params = array();
|
||||||
|
$params['name'] = $file->getName();
|
||||||
$params['document'] = $document->getName();
|
$params['document'] = $document->getName();
|
||||||
$params['document_id'] = $document->getId();
|
$params['document_id'] = $document->getId();
|
||||||
$params['username'] = $user->getFullName();
|
$params['username'] = $user->getFullName();
|
||||||
|
@ -1000,11 +1009,19 @@ class SeedDMS_NotificationService {
|
||||||
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
|
|
||||||
/* Send mail to uploader of version */
|
/* Send mail to uploader of version only if the uploader is not the owner and
|
||||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
* the currently logged in user is not the
|
||||||
|
* owner and the owner is not already in the list of notifiers.
|
||||||
|
*/
|
||||||
|
if($user->getID() != $content->getUser()->getID() && $content->getUser()->getID() != $document->getOwner() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This notification is sent when a user or group was added as a notifier
|
||||||
|
*
|
||||||
|
* @param object $obj user or group being added
|
||||||
|
*/
|
||||||
public function sendNewDocumentNotifyMail($document, $user, $obj) { /* {{{ */
|
public function sendNewDocumentNotifyMail($document, $user, $obj) { /* {{{ */
|
||||||
$folder = $document->getFolder();
|
$folder = $document->getFolder();
|
||||||
$subject = "document_notify_added_email_subject";
|
$subject = "document_notify_added_email_subject";
|
||||||
|
@ -1024,6 +1041,11 @@ class SeedDMS_NotificationService {
|
||||||
$this->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
$this->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This notification is sent when a user or group was added as a notifier
|
||||||
|
*
|
||||||
|
* @param object $obj user or group being added
|
||||||
|
*/
|
||||||
public function sendNewFolderNotifyMail($folder, $user, $obj) { /* {{{ */
|
public function sendNewFolderNotifyMail($folder, $user, $obj) { /* {{{ */
|
||||||
$subject = "folder_notify_added_email_subject";
|
$subject = "folder_notify_added_email_subject";
|
||||||
$message = "folder_notify_added_email_body";
|
$message = "folder_notify_added_email_body";
|
||||||
|
@ -1106,8 +1128,11 @@ class SeedDMS_NotificationService {
|
||||||
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
|
|
||||||
/* Send mail to uploader of version */
|
/* Send mail to uploader of version only if the uploader is not the owner and
|
||||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
* the currently logged in user is not the
|
||||||
|
* owner and the owner is not already in the list of notifiers.
|
||||||
|
*/
|
||||||
|
if($user->getID() != $content->getUser()->getID() && $content->getUser()->getID() != $document->getOwner() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -1139,8 +1164,11 @@ class SeedDMS_NotificationService {
|
||||||
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
if($user->getID() != $document->getOwner()->getID() && false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
|
|
||||||
/* Send mail to uploader of version */
|
/* Send mail to uploader of version only if the uploader is not the owner and
|
||||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
* the currently logged in user is not the
|
||||||
|
* owner and the owner is not already in the list of notifiers.
|
||||||
|
*/
|
||||||
|
if($user->getID() != $content->getUser()->getID() && $content->getUser()->getID() != $document->getOwner() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -182,13 +182,20 @@ else if ($action == "setdefault") {
|
||||||
|
|
||||||
// Modify permission ------------------------------------------------------
|
// Modify permission ------------------------------------------------------
|
||||||
else if ($action == "editaccess") {
|
else if ($action == "editaccess") {
|
||||||
|
$oldmode = $mode;
|
||||||
if (isset($userid)) {
|
if (isset($userid)) {
|
||||||
$folder->changeAccess($mode, $userid, true);
|
$oldmode = $folder->changeAccess($mode, $userid, true);
|
||||||
}
|
}
|
||||||
else if (isset($groupid)) {
|
else if (isset($groupid)) {
|
||||||
$folder->changeAccess($mode, $groupid, false);
|
$oldmode = $folder->changeAccess($mode, $groupid, false);
|
||||||
|
}
|
||||||
|
if($oldmode != $mode) {
|
||||||
|
if($notifier) {
|
||||||
|
// Send notification to subscribers.
|
||||||
|
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||||
|
}
|
||||||
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_access')));
|
||||||
}
|
}
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_access')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete Permission ------------------------------------------------------
|
// Delete Permission ------------------------------------------------------
|
||||||
|
@ -200,6 +207,10 @@ else if ($action == "delaccess") {
|
||||||
else if (isset($groupid)) {
|
else if (isset($groupid)) {
|
||||||
$folder->removeAccess($groupid, false);
|
$folder->removeAccess($groupid, false);
|
||||||
}
|
}
|
||||||
|
if($notifier) {
|
||||||
|
// Send notification to subscribers.
|
||||||
|
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||||
|
}
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_delete_access')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_delete_access')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,6 +223,10 @@ else if ($action == "addaccess") {
|
||||||
if (isset($groupid) && $groupid != -1) {
|
if (isset($groupid) && $groupid != -1) {
|
||||||
$folder->addAccess($mode, $groupid, false);
|
$folder->addAccess($mode, $groupid, false);
|
||||||
}
|
}
|
||||||
|
if($notifier) {
|
||||||
|
// Send notification to subscribers.
|
||||||
|
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||||
|
}
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_access')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_access')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ else if ($action == "addnotify") {
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||||
|
/* Send notification only to the user being added as a notifier */
|
||||||
if($notifier) {
|
if($notifier) {
|
||||||
$obj = $dms->getUser($userid);
|
$obj = $dms->getUser($userid);
|
||||||
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
||||||
|
@ -148,6 +149,7 @@ else if ($action == "addnotify") {
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||||
|
/* Send notification only to the group being added as a notifier */
|
||||||
if($notifier) {
|
if($notifier) {
|
||||||
$obj = $dms->getGroup($groupid);
|
$obj = $dms->getGroup($groupid);
|
||||||
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
||||||
|
|
|
@ -913,28 +913,33 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
} else if(target_type == 'attachment' && target_id) {
|
} else if(target_type == 'attachment' && target_id) {
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if(files[i].size <= maxFileSize) {
|
var item = items[i]; //.webkitGetAsEntry();
|
||||||
var fd = new FormData();
|
if (item.isFile) {
|
||||||
fd.append('targettype', target_type);
|
item.file(function(file) {
|
||||||
fd.append('documentid', target_id);
|
if(file.size <= maxFileSize) {
|
||||||
fd.append('formtoken', obj.data('uploadformtoken'));
|
var fd = new FormData();
|
||||||
fd.append('userfile', files[i]);
|
fd.append('targettype', target_type);
|
||||||
fd.append('command', 'addfile');
|
fd.append('documentid', target_id);
|
||||||
|
fd.append('formtoken', obj.data('uploadformtoken'));
|
||||||
|
fd.append('userfile', file);
|
||||||
|
fd.append('command', 'addfile');
|
||||||
|
|
||||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||||
status.setFileNameSize(files[i].name,files[i].size);
|
status.setFileNameSize(file.name,file.size);
|
||||||
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
||||||
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
noty({
|
noty({
|
||||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
text: maxFileSizeMsg + '<br /><em>' + file.name + ' (' + file.size + ' Bytes)</em>',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
dismissQueue: true,
|
dismissQueue: true,
|
||||||
layout: 'topRight',
|
layout: 'topRight',
|
||||||
theme: 'defaultTheme',
|
theme: 'defaultTheme',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -950,28 +950,33 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
} else if(target_type == 'attachment' && target_id) {
|
} else if(target_type == 'attachment' && target_id) {
|
||||||
for (var i = 0; i < files.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if(files[i].size <= maxFileSize) {
|
var item = items[i]; //.webkitGetAsEntry();
|
||||||
var fd = new FormData();
|
if (item.isFile) {
|
||||||
fd.append('targettype', target_type);
|
item.file(function(file) {
|
||||||
fd.append('documentid', target_id);
|
if(file.size <= maxFileSize) {
|
||||||
fd.append('formtoken', obj.data('uploadformtoken'));
|
var fd = new FormData();
|
||||||
fd.append('userfile', files[i]);
|
fd.append('targettype', target_type);
|
||||||
fd.append('command', 'addfile');
|
fd.append('documentid', target_id);
|
||||||
|
fd.append('formtoken', obj.data('uploadformtoken'));
|
||||||
|
fd.append('userfile', file);
|
||||||
|
fd.append('command', 'addfile');
|
||||||
|
|
||||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||||
status.setFileNameSize(files[i].name,files[i].size);
|
status.setFileNameSize(file.name,file.size);
|
||||||
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
||||||
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
noty({
|
noty({
|
||||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
text: maxFileSizeMsg + '<br /><em>' + file.name + ' (' + file.size + ' Bytes)</em>',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
dismissQueue: true,
|
dismissQueue: true,
|
||||||
layout: 'topRight',
|
layout: 'topRight',
|
||||||
theme: 'defaultTheme',
|
theme: 'defaultTheme',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user