mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
05a3405f07
|
@ -2051,6 +2051,8 @@ class SeedDMS_Core_DMS {
|
|||
function search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=null, $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x3, $expirationstartdate=array(), $expirationenddate=array(), $reception=array()) { /* {{{ */
|
||||
$orderby = '';
|
||||
$revisionstartdate = $revisionenddate = '';
|
||||
$statusstartdate = array();
|
||||
$statusenddate = array();
|
||||
if(is_array($query)) {
|
||||
foreach(array('limit', 'offset', 'logicalmode', 'searchin', 'startFolder', 'owner', 'status', 'creationstartdate', 'creationenddate', 'modificationstartdate', 'modificationenddate', 'categories', 'attributes', 'mode', 'revisionstartdate', 'revisionenddate', 'expirationstartdate', 'expirationenddate', 'reception') as $paramname)
|
||||
${$paramname} = isset($query[$paramname]) ? $query[$paramname] : ${$paramname};
|
||||
|
|
|
@ -4030,6 +4030,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return $this->_reviewStatus;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get the latest entries from the review log of the document content
|
||||
*
|
||||
* @param integer $limit the number of log entries returned, defaults to 1
|
||||
* @return array list of review log entries
|
||||
*/
|
||||
function getReviewLog($limit=1) { /* {{{ */
|
||||
$db = $this->_document->getDMS()->getDB();
|
||||
|
||||
if (!is_numeric($limit)) return false;
|
||||
|
||||
$queryStr=
|
||||
"SELECT * FROM `tblDocumentReviewLog` LEFT JOIN `tblDocumentReviewers` ON `tblDocumentReviewLog`.`reviewID` = `tblDocumentReviewers`.`reviewID` WHERE `version`='".$this->_version
|
||||
."' AND `documentID` = '". $this->_document->getID() ."' "
|
||||
."ORDER BY `tblDocumentReviewLog`.`reviewLogID` DESC LIMIT ".(int) $limit;
|
||||
$recs = $db->getResultArray($queryStr);
|
||||
if (is_bool($recs) && !$recs)
|
||||
return false;
|
||||
return($recs);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Rewrites the complete review log
|
||||
*
|
||||
|
@ -4187,6 +4208,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return $this->_approvalStatus;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get the latest entries from the approval log of the document content
|
||||
*
|
||||
* @param integer $limit the number of log entries returned, defaults to 1
|
||||
* @return array list of approval log entries
|
||||
*/
|
||||
function getApproveLog($limit=1) { /* {{{ */
|
||||
$db = $this->_document->getDMS()->getDB();
|
||||
|
||||
if (!is_numeric($limit)) return false;
|
||||
|
||||
$queryStr=
|
||||
"SELECT * FROM `tblDocumentApproveLog` LEFT JOIN `tblDocumentApprovers` ON `tblDocumentApproveLog`.`approveID` = `tblDocumentApprovers`.`approveID` WHERE `version`='".$this->_version
|
||||
."' AND `documentID` = '". $this->_document->getID() ."' "
|
||||
."ORDER BY `tblDocumentApproveLog`.`approveLogID` DESC LIMIT ".(int) $limit;
|
||||
$recs = $db->getResultArray($queryStr);
|
||||
if (is_bool($recs) && !$recs)
|
||||
return false;
|
||||
return($recs);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Rewrites the complete approval log
|
||||
*
|
||||
|
|
|
@ -1903,6 +1903,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
|
|||
<notes>
|
||||
- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content
|
||||
- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers()
|
||||
- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog()
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
|
|
|
@ -286,6 +286,7 @@ class SeedDMS_NotificationService {
|
|||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['comment'] = $document->getComment();
|
||||
$params['version'] = $lc->getVersion();
|
||||
$params['version_comment'] = $lc->getComment();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
|
@ -333,6 +334,15 @@ class SeedDMS_NotificationService {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* This notification is sent when a document version is deleted.
|
||||
* Keep in mind that $document refers to a document which has just been
|
||||
* deleted from the database, but all the data needed is still in the
|
||||
* object.
|
||||
*/
|
||||
public function sendDeleteDocumentVersionMail($document, $user) { /* {{{ */
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* This notification is sent when a new folder is created.
|
||||
*/
|
||||
|
@ -424,6 +434,54 @@ class SeedDMS_NotificationService {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* This notification is sent when a document content is replaced.
|
||||
*/
|
||||
public function sendReplaceContentMail($content, $user) { /* {{{ */
|
||||
$document = $content->getDocument();
|
||||
$folder = $document->getFolder();
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
||||
$subject = "replace_content_email_subject";
|
||||
$message = "replace_content_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['comment'] = $document->getComment();
|
||||
$params['version'] = $content->getVersion();
|
||||
$params['version_comment'] = $content->getComment();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* This notification is sent when a new attachment is created.
|
||||
*/
|
||||
public function sendDeleteFileMail($file, $user) { /* {{{ */
|
||||
$document = $file->getDocument();
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
||||
$subject = "removed_file_email_subject";
|
||||
$message = "removed_file_email_body";
|
||||
$params = array();
|
||||
$params['document'] = $document->getName();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedExpiryMail($document, $user, $oldexpires) { /* {{{ */
|
||||
$folder = $document->getFolder();
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
@ -453,6 +511,7 @@ class SeedDMS_NotificationService {
|
|||
} /* }}} */
|
||||
|
||||
public function sendChangedAttributesMail($document, $user, $oldattributes) { /* {{{ */
|
||||
$dms = $document->getDMS();
|
||||
$folder = $document->getFolder();
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
||||
|
@ -506,6 +565,60 @@ class SeedDMS_NotificationService {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedFolderAttributesMail($folder, $user, $oldattributes) { /* {{{ */
|
||||
$dms = $folder->getDMS();
|
||||
$notifyList = $folder->getNotifyList();
|
||||
|
||||
$newattributes = $folder->getAttributes();
|
||||
if($oldattributes) {
|
||||
foreach($oldattributes as $attrdefid=>$attribute) {
|
||||
if(!isset($newattributes[$attrdefid]) || $newattributes[$attrdefid]->getValueAsArray() !== $oldattributes[$attrdefid]->getValueAsArray()) {
|
||||
$subject = "folder_attribute_changed_email_subject";
|
||||
$message = "folder_attribute_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['attribute_name'] = $attribute->getAttributeDefinition()->getName();
|
||||
$params['attribute_old_value'] = $oldattributes[$attrdefid]->getValue();
|
||||
$params['attribute_new_value'] = isset($newattributes[$attrdefid]) ? $newattributes[$attrdefid]->getValue() : '';
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Check for new attributes which didn't have a value before */
|
||||
if($newattributes) {
|
||||
foreach($newattributes as $attrdefid=>$attribute) {
|
||||
if(!isset($oldattributes[$attrdefid]) && $attribute) {
|
||||
$subject = "folder_attribute_changed_email_subject";
|
||||
$message = "folder_attribute_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['attribute_name'] = $dms->getAttributeDefinition($attrdefid)->getName();
|
||||
$params['attribute_old_value'] = '';
|
||||
$params['attribute_new_value'] = $attribute->getValue();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedCommentMail($document, $user, $oldcomment) { /* {{{ */
|
||||
if($oldcomment != $document->getComment()) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
@ -534,6 +647,31 @@ class SeedDMS_NotificationService {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedFolderCommentMail($folder, $user, $oldcomment) { /* {{{ */
|
||||
if($oldcomment != $folder->getComment()) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
|
||||
$subject = "folder_comment_changed_email_subject";
|
||||
$message = "folder_comment_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['old_comment'] = $oldcomment;
|
||||
$params['new_comment'] = $comment;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// if user is not owner send notification to owner
|
||||
// if ($user->getID() != $folder->getOwner()->getID())
|
||||
// $notifier->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedVersionCommentMail($content, $user, $oldcomment) { /* {{{ */
|
||||
// FIXME: use extra mail template which includes the version
|
||||
if($oldcomment != $content->getComment()) {
|
||||
|
@ -592,6 +730,30 @@ class SeedDMS_NotificationService {
|
|||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedFolderNameMail($folder, $user, $oldname) { /* {{{ */
|
||||
if($oldname != $folder->getName()) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
|
||||
$subject = "folder_renamed_email_subject";
|
||||
$message = "folder_renamed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['old_name'] = $oldname;
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// if user is not owner send notification to owner
|
||||
// if ($user->getID() != $folder->getOwner()->getID())
|
||||
// $this->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendMovedDocumentMail($document, $user, $oldfolder) { /* {{{ */
|
||||
$targetfolder = $document->getFolder();
|
||||
if($targetfolder->getId() == $oldfolder->getId())
|
||||
|
@ -657,5 +819,254 @@ class SeedDMS_NotificationService {
|
|||
$this->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendTransferDocumentMail($document, $user, $oldowner) { /* {{{ */
|
||||
$folder = $document->getFolder();
|
||||
$nl = $document->getNotifyList();
|
||||
$subject = "document_transfered_email_subject";
|
||||
$message = "document_transfered_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['newuser'] = $document->getOwner()->getFullName();
|
||||
$params['olduser'] = $oldowner->getFullName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$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);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedDocumentStatusMail($content, $user, $oldstatus) { /* {{{ */
|
||||
$document = $content->getDocument();
|
||||
$overallStatus = $content->getStatus();
|
||||
$nl = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "document_status_changed_email_subject";
|
||||
$message = "document_status_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getOverallStatusText($overallStatus["status"]);
|
||||
$params['old_status'] = getOverallStatusText($oldstatus);
|
||||
$params['new_status_code'] = $overallStatus["status"];
|
||||
$params['old_status_code'] = $oldstatus;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$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);
|
||||
}
|
||||
|
||||
// $notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
} /* }}} */
|
||||
|
||||
public function sendNewDocumentNotifyMail($document, $user, $obj) { /* {{{ */
|
||||
$folder = $document->getFolder();
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
if($obj->isType('user'))
|
||||
$this->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
elseif($obj->isType('group'))
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
} /* }}} */
|
||||
|
||||
public function sendNewFolderNotifyMail($folder, $user, $obj) { /* {{{ */
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
if($obj->isType('user'))
|
||||
$this->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
elseif($obj->isType('group'))
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
} /* }}} */
|
||||
|
||||
public function sendDeleteDocumentNotifyMail($document, $user, $obj) { /* {{{ */
|
||||
$folder = $document->getFolder();
|
||||
$subject = "notify_deleted_email_subject";
|
||||
$message = "notify_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
if($obj->isType('user'))
|
||||
$this->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
elseif($obj->isType('group'))
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
} /* }}} */
|
||||
|
||||
public function sendDeleteFolderNotifyMail($folder, $user, $obj) { /* {{{ */
|
||||
$subject = "notify_deleted_email_subject";
|
||||
$message = "notify_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
|
||||
if($obj->isType('user'))
|
||||
$this->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
elseif($obj->isType('group'))
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
} /* }}} */
|
||||
|
||||
public function sendSubmittedReviewMail($content, $user, $reviewlog) { /* {{{ */
|
||||
$document = $content->getDocument();
|
||||
$nl=$document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "review_submit_email_subject";
|
||||
$message = "review_submit_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $content->getVersion();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getReviewStatusText($reviewlog["status"]);
|
||||
$params['comment'] = $reviewlog['comment'];
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$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);
|
||||
}
|
||||
// $notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
} /* }}} */
|
||||
|
||||
public function sendSubmittedApprovalMail($content, $user, $approvelog) { /* {{{ */
|
||||
$document = $content->getDocument();
|
||||
$nl=$document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "approval_submit_email_subject";
|
||||
$message = "approval_submit_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $content->getVersion();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getApprovalStatusText($approvelog["status"]);
|
||||
$params['comment'] = $approvelog['comment'];
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID()."¤ttab=revapp";
|
||||
|
||||
$this->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp)
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
// $this->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedDocumentOwnerMail($document, $user, $oldowner) { /* {{{ */
|
||||
if($oldowner->getID() != $document->getOwner()->getID()) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "ownership_changed_email_subject";
|
||||
$message = "ownership_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['old_owner'] = $oldowner->getFullName();
|
||||
$params['new_owner'] = $document->getOwner()->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// $notifier->toIndividual($user, $oldowner, $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedFolderOwnerMail($folder, $user, $oldowner) { /* {{{ */
|
||||
if($oldowner->getID() != $folder->getOwner()->getID()) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "ownership_changed_email_subject";
|
||||
$message = "ownership_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['old_owner'] = $oldowner->getFullName();
|
||||
$params['new_owner'] = $folder->getOwner()->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedDocumentAccessMail($document, $user) { /* {{{ */
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
public function sendChangedFolderAccessMail($folder, $user) { /* {{{ */
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $this->settings->_siteName;
|
||||
$params['http_root'] = $this->settings->_httpRoot;
|
||||
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -122,30 +122,6 @@ if(!$subFolder = $controller->run()) {
|
|||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifier->sendNewFolderMail($subFolder, $user);
|
||||
/*
|
||||
$fnl = $folder->getNotifyList();
|
||||
$snl = $subFolder->getNotifyList();
|
||||
$nl = array(
|
||||
'users'=>array_unique(array_merge($snl['users'], $fnl['users']), SORT_REGULAR),
|
||||
'groups'=>array_unique(array_merge($snl['groups'], $fnl['groups']), SORT_REGULAR)
|
||||
);
|
||||
|
||||
$subject = "new_subfolder_email_subject";
|
||||
$message = "new_subfolder_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $subFolder->getName();
|
||||
$params['folder_name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['comment'] = $comment;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$subFolder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,27 +111,8 @@ if(!$controller->run()) {
|
|||
if ($_POST["approvalType"] == "ind" || $_POST["approvalType"] == "grp") {
|
||||
// Send an email notification to the document updater.
|
||||
if($notifier) {
|
||||
$subject = "approval_submit_email_subject";
|
||||
$message = "approval_submit_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $version;
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getApprovalStatusText($_POST["approvalStatus"]);
|
||||
$params['comment'] = strip_tags($_POST['comment']);
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID()."¤ttab=revapp";
|
||||
|
||||
$notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
// Send notification to subscribers.
|
||||
$nl=$document->getNotifyList();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$approvelog = $latestContent->getApproveLog();
|
||||
$notifier->sendSubmittedApprovalMail($latestContent, $user, $approvelog ? $approvelog[0] : false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ if($action == 'setowner') {
|
|||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
if (empty($_GET["ownerid"])) {
|
||||
if (!isset($_GET["ownerid"]) || !is_numeric($_GET["ownerid"]) || $_GET["ownerid"]<1) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_group"));
|
||||
}
|
||||
if (!($newowner = $dms->getUser($_GET["ownerid"]))) {
|
||||
|
@ -130,7 +130,6 @@ if($action == 'setowner') {
|
|||
$oldowner = $document->getOwner();
|
||||
}
|
||||
|
||||
|
||||
$controller->setParam('document', $document);
|
||||
$controller->setParam('folder', $folder);
|
||||
$controller->setParam('settings', $settings);
|
||||
|
@ -145,27 +144,10 @@ if(!$controller->run()) {
|
|||
|
||||
// Change owner -----------------------------------------------------------
|
||||
if ($action == "setowner") {
|
||||
if($notifier) {
|
||||
$notifier->sendChangedDocumentOwnerMail($document, $user, $oldowner);
|
||||
}
|
||||
if($oldowner->getID() != $newowner->getID()) {
|
||||
if($notifier) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "ownership_changed_email_subject";
|
||||
$message = "ownership_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['old_owner'] = $oldowner->getFullName();
|
||||
$params['new_owner'] = $newowner->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// $notifier->toIndividual($user, $oldowner, $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_setowner')));
|
||||
}
|
||||
}
|
||||
|
@ -173,69 +155,26 @@ if ($action == "setowner") {
|
|||
// Change to not inherit ---------------------------------------------------
|
||||
else if ($action == "notinherit") {
|
||||
|
||||
if($notifier) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_notinherit_access')));
|
||||
if($notifier) {
|
||||
$notifier->sendChangedDocumentAccessMail($document, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_notinherit_access')));
|
||||
}
|
||||
|
||||
// Change to inherit-----------------------------------------------------
|
||||
else if ($action == "inherit") {
|
||||
if($notifier) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_inherit_access')));
|
||||
if($notifier) {
|
||||
$notifier->sendChangedDocumentAccessMail($document, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_inherit_access')));
|
||||
}
|
||||
|
||||
// Set default permissions ----------------------------------------------
|
||||
else if ($action == "setdefault") {
|
||||
if($notifier) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_set_default_access')));
|
||||
if($notifier) {
|
||||
$notifier->sendChangedDocumentAccessMail($document, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_set_default_access')));
|
||||
} elseif($action == "delaccess") {
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_delete_access')));
|
||||
} elseif($action == "addaccess") {
|
||||
|
|
|
@ -94,30 +94,16 @@ if ($action == "delnotify"){
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
break;
|
||||
case -3:
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("already_subscribed"));
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("not_subscribed"));
|
||||
break;
|
||||
case -4:
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_notify')));
|
||||
// Email user / group, informing them of subscription change.
|
||||
if($notifier) {
|
||||
$subject = "notify_deleted_email_subject";
|
||||
$message = "notify_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
if ($userid > 0) {
|
||||
$notifier->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
else {
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendDeleteFolderNotifyMail($folder, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -126,6 +112,7 @@ if ($action == "delnotify"){
|
|||
// add notification
|
||||
else if ($action == "addnotify") {
|
||||
|
||||
/* Both $userid and $groupid can be set */
|
||||
if ($userid > 0) {
|
||||
$res = $document->addNotify($userid, true);
|
||||
switch ($res) {
|
||||
|
@ -142,22 +129,11 @@ else if ($action == "addnotify") {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
// Email user / group, informing them of subscription.
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||
if ($notifier){
|
||||
$obj = $dms->getUser($userid);
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendNewDocumentNotifyMail($document, $user, $obj);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -177,19 +153,10 @@ else if ($action == "addnotify") {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||
if ($notifier){
|
||||
$obj = $dms->getGroup($groupid);
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendNewDocumentNotifyMail($document, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -97,111 +97,13 @@ if(!$controller->run()) {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())), $errmsg);
|
||||
}
|
||||
|
||||
if($oldname != $name) {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifier->sendChangedFolderNameMail($folder, $user, $oldname);
|
||||
|
||||
$subject = "folder_renamed_email_subject";
|
||||
$message = "folder_renamed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['old_name'] = $oldname;
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// if user is not owner send notification to owner
|
||||
// if ($user->getID() != $folder->getOwner()->getID())
|
||||
// $notifier->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
}
|
||||
}
|
||||
$notifier->sendChangedFolderCommentMail($folder, $user, $oldcomment);
|
||||
|
||||
if($oldcomment != $comment) {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
|
||||
$subject = "folder_comment_changed_email_subject";
|
||||
$message = "folder_comment_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['old_comment'] = $oldcomment;
|
||||
$params['new_comment'] = $comment;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// if user is not owner send notification to owner
|
||||
// if ($user->getID() != $folder->getOwner()->getID())
|
||||
// $notifier->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$newattributes = $folder->getAttributes();
|
||||
if($oldattributes) {
|
||||
foreach($oldattributes as $attrdefid=>$attribute) {
|
||||
if(!isset($newattributes[$attrdefid]) || $newattributes[$attrdefid]->getValueAsArray() !== $oldattributes[$attrdefid]->getValueAsArray()) {
|
||||
if($notifier) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "folder_attribute_changed_email_subject";
|
||||
$message = "folder_attribute_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['attribute_name'] = $attribute->getAttributeDefinition()->getName();
|
||||
$params['attribute_old_value'] = $oldattributes[$attrdefid]->getValue();
|
||||
$params['attribute_new_value'] = isset($newattributes[$attrdefid]) ? $newattributes[$attrdefid]->getValue() : '';
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Check for new attributes which didn't have a value before */
|
||||
if($newattributes) {
|
||||
foreach($newattributes as $attrdefid=>$attribute) {
|
||||
if(!isset($oldattributes[$attrdefid]) && $attribute) {
|
||||
if($notifier) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "folder_attribute_changed_email_subject";
|
||||
$message = "folder_attribute_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['attribute_name'] = $dms->getAttributeDefinition($attrdefid)->getName();
|
||||
$params['attribute_old_value'] = '';
|
||||
$params['attribute_new_value'] = $attribute->getValue();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$notifier->sendChangedFolderAttributesMail($folder, $user, $oldattributes);
|
||||
}
|
||||
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_folder_edited')));
|
||||
|
|
|
@ -73,25 +73,7 @@ if($lc->getChecksum() == SeedDMS_Core_File::checksum($tmpfname)) {
|
|||
} else {
|
||||
if($document->replaceContent(0, $user, $tmpfname, $lc->getOriginalFileName(), $lc->getFileType(), $lc->getMimeType())) {
|
||||
if($notifier) {
|
||||
$notifyList = $folder->getNotifyList();
|
||||
|
||||
$subject = "replace_content_email_subject";
|
||||
$message = "replace_content_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['comment'] = $document->getComment();
|
||||
$params['version'] = $lc->getVersion();
|
||||
$params['version_comment'] = $lc->getComment();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendReplaceContentMail($lc, $user);
|
||||
}
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_saved_file')));
|
||||
} else {
|
||||
|
|
|
@ -110,40 +110,20 @@ if (isset($_GET["groupid"])) {
|
|||
|
||||
// Change owner -----------------------------------------------------------
|
||||
if ($action == "setowner") {
|
||||
|
||||
if (!$user->isAdmin()) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
|
||||
}
|
||||
if (!isset($_GET["ownerid"]) || !is_numeric($_GET["ownerid"]) || $_GET["ownerid"]<1) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("unknown_user"));
|
||||
}
|
||||
$newOwner = $dms->getUser($_GET["ownerid"]);
|
||||
if (!is_object($newOwner)) {
|
||||
if (!($newowner = $dms->getUser($_GET["ownerid"]))) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("unknown_user"));
|
||||
}
|
||||
$oldOwner = $folder->getOwner();
|
||||
if($folder->setOwner($newOwner)) {
|
||||
if($folder->setOwner($newowner)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "ownership_changed_email_subject";
|
||||
$message = "ownership_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['old_owner'] = $oldOwner->getFullName();
|
||||
$params['new_owner'] = $newOwner->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendChangedFolderOwnerMail($folder, $user, $oldOwner);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_setowner')));
|
||||
} else {
|
||||
|
@ -156,49 +136,12 @@ else if ($action == "notinherit") {
|
|||
|
||||
$defAccess = $folder->getDefaultAccess();
|
||||
if($folder->setInheritAccess(false)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
if($folder->setDefaultAccess($defAccess)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_notinherit_access')));
|
||||
}
|
||||
}
|
||||
if($folder->setDefaultAccess($defAccess)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_notinherit_access')));
|
||||
}
|
||||
}
|
||||
if ($mode == "copy") {
|
||||
|
@ -220,23 +163,7 @@ else if ($action == "inherit") {
|
|||
if($folder->setInheritAccess(true)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_inherit_access')));
|
||||
}
|
||||
|
@ -247,23 +174,7 @@ else if ($action == "setdefault") {
|
|||
if($folder->setDefaultAccess($mode)) {
|
||||
if($notifier) {
|
||||
// Send notification to subscribers.
|
||||
$notifyList = $folder->getNotifyList();
|
||||
$subject = "access_permission_changed_email_subject";
|
||||
$message = "access_permission_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
if($folder->getParent())
|
||||
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
|
||||
else
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendChangedFolderAccessMail($folder, $user);
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_set_default_access')));
|
||||
}
|
||||
|
|
|
@ -89,30 +89,15 @@ if ($action == "delnotify") {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
|
||||
break;
|
||||
case -3:
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("already_subscribed"));
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("not_subscribed"));
|
||||
break;
|
||||
case -4:
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_notify')));
|
||||
if($notifier) {
|
||||
// Email user / group, informing them of subscription.
|
||||
$subject = "notify_deleted_email_subject";
|
||||
$message = "notify_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
if ($userid > 0) {
|
||||
$notifier->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
else {
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendDeleteFolderNotifyMail($folder, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -137,20 +122,10 @@ else if ($action == "addnotify") {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||
if($notifier) {
|
||||
$obj = $dms->getUser($userid);
|
||||
// Email user / group, informing them of subscription.
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -172,20 +147,10 @@ else if ($action == "addnotify") {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||
if($notifier) {
|
||||
$obj = $dms->getGroup($groupid);
|
||||
// Email user / group, informing them of subscription.
|
||||
$subject = "notify_added_email_subject";
|
||||
$message = "notify_added_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toGroup($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendNewFolderNotifyMail($folder, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -81,8 +81,55 @@ if ($_GET["type"]=="document"){
|
|||
if ($document->getAccessMode($user) < M_READ)
|
||||
UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
||||
if ($_GET["action"]=="add") $document->addNotify($userid, true);
|
||||
else if ($_GET["action"]=="del") $document->removeNotify($userid, true);
|
||||
if ($_GET["action"]=="add") {
|
||||
$res = $document->addNotify($userid, true);
|
||||
switch ($res) {
|
||||
case -1:
|
||||
UI::exitError(getMLText("my_account"), getMLText("unknown_user"));
|
||||
break;
|
||||
case -2:
|
||||
UI::exitError(getMLText("my_account"), getMLText("access_denied"));
|
||||
break;
|
||||
case -3:
|
||||
UI::exitError(getMLText("my_account"), getMLText("already_subscribed"));
|
||||
break;
|
||||
case -4:
|
||||
UI::exitError(getMLText("my_account"), getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_add_notify')));
|
||||
// Email user / group, informing them of subscription.
|
||||
if ($notifier){
|
||||
$obj = $dms->getUser($userid);
|
||||
$notifier->sendNewDocumentNotifyMail($document, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} elseif ($_GET["action"]=="del") {
|
||||
$res = $document->removeNotify($userid, true);
|
||||
switch ($res) {
|
||||
case -1:
|
||||
UI::exitError(getMLText("my_account"), getMLText("unknown_user"));
|
||||
break;
|
||||
case -2:
|
||||
UI::exitError(getMLText("my_account"), getMLText("access_denied"));
|
||||
break;
|
||||
case -3:
|
||||
UI::exitError(getMLText("my_account"), getMLText("not_subscribed"));
|
||||
break;
|
||||
case -4:
|
||||
UI::exitError(getMLText("my_account"), getMLText("internal_error"));
|
||||
break;
|
||||
case 0:
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_notify')));
|
||||
// Email user / group, informing them of subscription change.
|
||||
if($notifier) {
|
||||
$obj = $dms->getUser($userid);
|
||||
$notifier->sendDeleteDocumentNotifyMail($document, $user, $obj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($_GET["type"]=="folder") {
|
||||
|
||||
|
@ -113,18 +160,7 @@ if ($_GET["type"]=="document"){
|
|||
if(0 == $folder->removeNotify($userid, true)) {
|
||||
if($notifier) {
|
||||
$obj = $dms->getUser($userid);
|
||||
// Email user / group, informing them of subscription.
|
||||
$subject = "notify_deleted_email_subject";
|
||||
$message = "notify_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $folder->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
|
||||
$notifier->toIndividual($user, $obj, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendDeleteFolderNotifyMail($folder, $user, $obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,26 +87,7 @@ if ($overrideStatus != $overallStatus["status"]) {
|
|||
} else {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$nl = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "document_status_changed_email_subject";
|
||||
$message = "document_status_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getOverallStatusText($overallStatus['status']).' → '.getOverallStatusText($overrideStatus);
|
||||
$params['new_status_code'] = $overrideStatus;
|
||||
$params['old_status_code'] = $overallStatus["status"];
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
|
||||
// $notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,20 +68,7 @@ if (!$document->removeDocumentFile($fileid)) {
|
|||
} else {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
||||
$subject = "removed_file_email_subject";
|
||||
$message = "removed_file_email_body";
|
||||
$params = array();
|
||||
$params['document'] = $document->getName();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($notifyList["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendDeleteFileMail($file, $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,21 +86,6 @@ if(!$controller->run()) {
|
|||
|
||||
if ($notifier) {
|
||||
$notifier->sendDeleteFolderMail($folder, $user);
|
||||
/*
|
||||
$subject = "folder_deleted_email_subject";
|
||||
$message = "folder_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $foldername;
|
||||
$params['folder_path'] = $parent->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$parent->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
add_log_line("?folderid=".$folderid."&name=".$foldername);
|
||||
|
|
|
@ -67,37 +67,33 @@ $folder = $document->getFolder();
|
|||
/* Check if there is just one version. In that case remove the document */
|
||||
if (count($document->getContent())==1) {
|
||||
$previewer->deleteDocumentPreviews($document);
|
||||
$nl = $document->getNotifyList();
|
||||
$docname = $document->getName();
|
||||
if (!$document->remove()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
} else {
|
||||
$nexturl = "../out/out.ViewFolder.php?folderid=".$folder->getId();
|
||||
/* Remove the document from the fulltext index */
|
||||
if($fulltextservice && ($index = $fulltextservice->Index())) {
|
||||
$lucenesearch = $fulltextservice->Search();
|
||||
if($hit = $lucenesearch->getDocument($documentid)) {
|
||||
$index->delete($hit->id);
|
||||
$index->commit();
|
||||
}
|
||||
}
|
||||
|
||||
if ($notifier){
|
||||
$subject = "document_deleted_email_subject";
|
||||
$message = "document_deleted_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $docname;
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
/* Get the notify list before removing the document
|
||||
* Also inform the users/groups of the parent folder
|
||||
* Getting the list now will keep them in the document object
|
||||
* even after the document has been deleted.
|
||||
*/
|
||||
$dnl = $document->getNotifyList();
|
||||
$fnl = $folder->getNotifyList();
|
||||
$docname = $document->getName();
|
||||
|
||||
$controller->setParam('document', $document);
|
||||
$controller->setParam('fulltextservice', $fulltextservice);
|
||||
if(!$controller->run()) {
|
||||
if ($controller->getErrorMsg() != '')
|
||||
$errormsg = $controller->getErrorMsg();
|
||||
else
|
||||
$errormsg = "error_remove_document";
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($docname))),getMLText($errormsg));
|
||||
}
|
||||
|
||||
if ($notifier){
|
||||
/* $document still has the data from the just deleted document,
|
||||
* which is just enough to send the email.
|
||||
*/
|
||||
$notifier->sendDeleteDocumentMail($document, $user);
|
||||
}
|
||||
$nexturl = "../out/out.ViewFolder.php?folderid=".$folder->getId();
|
||||
}
|
||||
else {
|
||||
/* Before deleting the content get a list of all users that should
|
||||
|
@ -129,7 +125,7 @@ else {
|
|||
|
||||
$previewer->deletePreview($version, $settings->_previewWidthDetail);
|
||||
$previewer->deletePreview($version, $settings->_previewWidthList);
|
||||
/* Check if the version to be delete is the latest version. This is
|
||||
/* Check if the version to be deleted is the latest version. This is
|
||||
* later used to set the redirect url.
|
||||
*/
|
||||
$islatest = $version->getVersion() == $document->getLatestContent()->getVersion();
|
||||
|
|
|
@ -110,24 +110,8 @@ if(!$controller->run()) {
|
|||
|
||||
if ($_POST["reviewType"] == "ind" || $_POST["reviewType"] == "grp") {
|
||||
if($notifier) {
|
||||
$nl=$document->getNotifyList();
|
||||
$subject = "review_submit_email_subject";
|
||||
$message = "review_submit_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $version;
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getReviewStatusText($_POST["reviewStatus"]);
|
||||
$params['comment'] = strip_tags($_POST['comment']);
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID()."¤ttab=revapp";
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// $notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
$reviewlog = $latestContent->getReviewLog();
|
||||
$notifier->sendSubmittedReviewMail($latestContent, $user, $reviewlog ? $reviewlog[0] : false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,10 +30,6 @@ include("../inc/inc.Authentication.php");
|
|||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
if (!$accessop->check_controller_access($controller, $_POST)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => "")),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
/* Check if the form data comes from a trusted request */
|
||||
if(!checkFormKey('transferdocument')) {
|
||||
|
@ -61,6 +57,7 @@ if (!is_object($newuser)) {
|
|||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
$oldowner = $document->getOwner();
|
||||
|
||||
$controller->setParam('document', $document);
|
||||
$controller->setParam('newuser', $newuser);
|
||||
|
@ -70,21 +67,7 @@ if(!$controller->run()) {
|
|||
|
||||
if ($notifier){
|
||||
/* Get the notify list before removing the document */
|
||||
$nl = $document->getNotifyList();
|
||||
$subject = "document_transfered_email_subject";
|
||||
$message = "document_transfered_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['newuser'] = $newuser->getFullName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
$notifier->sendTransferDocumentMail($document, $user, $oldowner);
|
||||
}
|
||||
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_transfer_document')));
|
||||
|
|
|
@ -147,12 +147,12 @@ $(document).ready( function() {
|
|||
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
|
||||
$this->warningMsg($msg);
|
||||
|
||||
$this->contentContainerStart();
|
||||
?>
|
||||
|
||||
<form class="form-horizontal" action="../op/op.AddFile.php" enctype="multipart/form-data" method="post" name="form1" id="form1">
|
||||
<input type="hidden" name="documentid" value="<?php print $document->getId(); ?>">
|
||||
<?php
|
||||
$this->contentContainerStart();
|
||||
$this->formField(
|
||||
getMLText("local_file"),
|
||||
($enablelargefileupload ? $this->getFineUploaderHtml() : $this->getFileChooserHtml('userfile[]', false))
|
||||
|
@ -205,11 +205,11 @@ $(document).ready( function() {
|
|||
)
|
||||
);
|
||||
}
|
||||
$this->contentContainerEnd();
|
||||
$this->formSubmit(getMLText('add'));
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
$this->contentContainerEnd();
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user