mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
5e386597c3
|
@ -218,6 +218,9 @@
|
|||
--------------------------------------------------------------------------------
|
||||
- certain fields in configuration can be disabled for editing, also works for
|
||||
configuration fields of extensions
|
||||
- send notification mail to owner of document and uploader of a version
|
||||
- new mail body for changing a version comment
|
||||
- add hook documentListPreview
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.24
|
||||
|
|
|
@ -50,8 +50,9 @@ class SeedDMS_NotificationService {
|
|||
const RECV_REVIEWER = 3;
|
||||
const RECV_APPROVER = 4;
|
||||
const RECV_WORKFLOW = 5;
|
||||
const RECV_REVISOR = 6;
|
||||
const RECV_RECIPIENT = 7;
|
||||
const RECV_UPLOADER = 6;
|
||||
const RECV_REVISOR = 7;
|
||||
const RECV_RECIPIENT = 8;
|
||||
|
||||
public function __construct($logger = null, $settings = null) { /* {{{ */
|
||||
$this->services = array();
|
||||
|
@ -421,6 +422,10 @@ class SeedDMS_NotificationService {
|
|||
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);
|
||||
|
||||
/* Send mail to uploader of version */
|
||||
if($user->getID() != $version->getUser()->getID() && false === SeedDMS_Core_DMS::inList($version->getUser(), $nl['users']))
|
||||
$this->toIndividual($user, $version->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
@ -546,6 +551,9 @@ class SeedDMS_NotificationService {
|
|||
false === SeedDMS_Core_DMS::inList($document->getOwner(), $notifyList['users']))
|
||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
/* Send mail to uploader of version */
|
||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
@ -767,8 +775,8 @@ class SeedDMS_NotificationService {
|
|||
$document = $content->getDocument();
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "document_comment_changed_email_subject";
|
||||
$message = "document_comment_changed_email_body";
|
||||
$subject = "version_comment_changed_email_subject";
|
||||
$message = "version_comment_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $content->getVersion();
|
||||
|
@ -965,7 +973,11 @@ class SeedDMS_NotificationService {
|
|||
* 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);
|
||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
/* Send mail to uploader of version */
|
||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||
} /* }}} */
|
||||
|
||||
public function sendNewDocumentNotifyMail($document, $user, $obj) { /* {{{ */
|
||||
|
@ -1062,7 +1074,11 @@ class SeedDMS_NotificationService {
|
|||
* 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);
|
||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
/* Send mail to uploader of version */
|
||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||
} /* }}} */
|
||||
|
||||
public function sendSubmittedApprovalMail($content, $user, $approvelog) { /* {{{ */
|
||||
|
@ -1090,8 +1106,11 @@ class SeedDMS_NotificationService {
|
|||
* 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);
|
||||
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
/* Send mail to uploader of version */
|
||||
if($user->getID() != $content->getUser()->getID() && false === SeedDMS_Core_DMS::inList($content->getUser(), $nl['users']))
|
||||
$this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_UPLOADER);
|
||||
} /* }}} */
|
||||
|
||||
public function sendDeleteApprovalMail($content, $user, $approver) { /* {{{ */
|
||||
|
|
|
@ -3030,15 +3030,20 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$content .= "<td>";
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||
if(is_string($previewhtml))
|
||||
$content .= $previewhtml;
|
||||
else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
} else
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$content .= "</td>";
|
||||
|
|
|
@ -3016,15 +3016,20 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$content .= "<td>";
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||
if(is_string($previewhtml))
|
||||
$content .= $previewhtml;
|
||||
else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
} else
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$content .= "</td>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user